@aquera/nile-elements 0.0.3-9 → 0.0.4-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/internal/watch.d.ts +3 -3
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js +186 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.d.ts +70 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +477 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.d.ts +1 -17
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js +13 -317
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-drawer/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-footer/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-error-message/nile-form-error-message.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-heading/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-loader/nile-loader.js +2 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-loader/nile-loader.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-menu/nile-menu.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-popup/nile-popup.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-progress-bar/nile-progress-bar.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio/nile-radio.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-sidebar/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-spinner/nile-spinner.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toolbar/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/watch.d.ts +3 -3
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/custom-element-fc8dd455.cjs.js.map +1 -1
- package/dist/index-cd2f9c12.esm.js +35 -0
- package/dist/index-cd83c5c8.cjs.js +22 -0
- package/dist/index-cd83c5c8.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +441 -280
- package/dist/internal/animate.cjs.js +1 -1
- package/dist/internal/animate.cjs.js.map +1 -1
- package/dist/internal/default-value.cjs.js.map +1 -1
- package/dist/internal/event.cjs.js.map +1 -1
- package/dist/internal/form.cjs.js +1 -1
- package/dist/internal/form.cjs.js.map +1 -1
- package/dist/internal/nile-element.cjs.js.map +1 -1
- package/dist/internal/offset.cjs.js.map +1 -1
- package/dist/internal/scroll.cjs.js.map +1 -1
- package/dist/internal/slot.cjs.js +1 -1
- package/dist/internal/slot.cjs.js.map +1 -1
- package/dist/internal/tabbable.cjs.js.map +1 -1
- package/dist/internal/watch.cjs.js +1 -1
- package/dist/internal/watch.cjs.js.map +1 -1
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/index.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +2 -2
- package/dist/nile-badge/index.cjs.js.map +1 -1
- package/dist/nile-button/index.cjs.js +1 -1
- package/dist/nile-button/index.esm.js +1 -1
- package/dist/nile-button/nile-button.cjs.js +1 -1
- package/dist/nile-button/nile-button.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.css.cjs.js +1 -1
- package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.css.esm.js +1 -1
- package/dist/nile-button/nile-button.esm.js +2 -2
- package/dist/nile-calendar/index.cjs.js +2 -0
- package/dist/nile-calendar/index.cjs.js.map +1 -0
- package/dist/nile-calendar/index.esm.js +1 -0
- package/dist/nile-calendar/nile-calendar.cjs.js +2 -0
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -0
- package/dist/nile-calendar/nile-calendar.css.cjs.js +2 -0
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -0
- package/dist/nile-calendar/nile-calendar.css.esm.js +174 -0
- package/dist/nile-calendar/nile-calendar.esm.js +68 -0
- package/dist/nile-checkbox/index.cjs.js +1 -1
- package/dist/nile-checkbox/index.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.esm.js +2 -2
- package/dist/nile-chip/index.cjs.js +1 -1
- package/dist/nile-chip/index.esm.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.css.esm.js +1 -1
- package/dist/nile-chip/nile-chip.esm.js +2 -2
- package/dist/nile-date-picker/index.cjs.js +1 -1
- package/dist/nile-date-picker/index.esm.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
- package/dist/nile-date-picker/nile-date-picker.css.cjs.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.css.cjs.js.map +1 -1
- package/dist/nile-date-picker/nile-date-picker.css.esm.js +2 -2
- package/dist/nile-date-picker/nile-date-picker.esm.js +9 -83
- package/dist/nile-drawer/index.cjs.js +1 -1
- package/dist/nile-drawer/index.cjs.js.map +1 -1
- package/dist/nile-drawer/index.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.esm.js +1 -1
- package/dist/nile-dropdown/index.cjs.js +1 -1
- package/dist/nile-dropdown/index.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
- package/dist/nile-dropdown/nile-dropdown.css.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.css.cjs.js.map +1 -1
- package/dist/nile-dropdown/nile-dropdown.css.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.esm.js +2 -2
- package/dist/nile-error-message/index.cjs.js +1 -1
- package/dist/nile-error-message/index.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.esm.js +2 -2
- package/dist/nile-footer/index.cjs.js +1 -1
- package/dist/nile-footer/index.cjs.js.map +1 -1
- package/dist/nile-footer/index.esm.js +1 -1
- package/dist/nile-footer/nile-footer.css.cjs.js +1 -1
- package/dist/nile-footer/nile-footer.css.cjs.js.map +1 -1
- package/dist/nile-footer/nile-footer.css.esm.js +1 -1
- package/dist/nile-form-error-message/index.cjs.js +1 -1
- package/dist/nile-form-error-message/index.esm.js +1 -1
- package/dist/nile-form-error-message/nile-form-error-message.cjs.js +1 -1
- package/dist/nile-form-error-message/nile-form-error-message.cjs.js.map +1 -1
- package/dist/nile-form-error-message/nile-form-error-message.css.cjs.js +1 -1
- package/dist/nile-form-error-message/nile-form-error-message.css.cjs.js.map +1 -1
- package/dist/nile-form-error-message/nile-form-error-message.css.esm.js +1 -1
- package/dist/nile-form-error-message/nile-form-error-message.esm.js +2 -2
- package/dist/nile-form-help-text/index.cjs.js +1 -1
- package/dist/nile-form-help-text/index.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js.map +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.css.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.esm.js +2 -2
- package/dist/nile-heading/index.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/index.esm.js +1 -1
- package/dist/nile-icon/index.cjs.js +1 -1
- package/dist/nile-icon/index.cjs.js.map +1 -1
- package/dist/nile-icon/index.esm.js +1 -1
- package/dist/nile-icon/utils.cjs.js.map +1 -1
- package/dist/nile-icon-button/index.cjs.js +1 -1
- package/dist/nile-icon-button/index.esm.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.css.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.css.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.css.esm.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +2 -2
- package/dist/nile-input/index.cjs.js +1 -1
- package/dist/nile-input/index.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.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +1 -1
- package/dist/nile-input/nile-input.esm.js +2 -2
- package/dist/nile-loader/index.cjs.js +1 -1
- package/dist/nile-loader/index.esm.js +1 -1
- package/dist/nile-loader/nile-loader.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.cjs.js.map +1 -1
- package/dist/nile-loader/nile-loader.css.cjs.js.map +1 -1
- package/dist/nile-loader/nile-loader.esm.js +2 -2
- package/dist/nile-menu/index.cjs.js +1 -1
- package/dist/nile-menu/index.esm.js +1 -1
- package/dist/nile-menu/nile-menu.cjs.js +1 -1
- package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
- package/dist/nile-menu/nile-menu.css.cjs.js +1 -1
- package/dist/nile-menu/nile-menu.css.cjs.js.map +1 -1
- package/dist/nile-menu/nile-menu.css.esm.js +1 -1
- package/dist/nile-menu/nile-menu.esm.js +2 -2
- package/dist/nile-menu-item/index.cjs.js +1 -1
- package/dist/nile-menu-item/index.esm.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.css.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.css.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.css.esm.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.esm.js +2 -2
- package/dist/nile-option/index.cjs.js +1 -1
- package/dist/nile-option/index.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.cjs.js +1 -1
- package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.esm.js +1 -1
- package/dist/nile-option/nile-option.esm.js +2 -2
- package/dist/nile-popup/index.cjs.js +1 -1
- package/dist/nile-popup/index.esm.js +1 -1
- package/dist/nile-popup/nile-popup.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.cjs.js.map +1 -1
- package/dist/nile-popup/nile-popup.css.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.css.cjs.js.map +1 -1
- package/dist/nile-popup/nile-popup.css.esm.js +1 -1
- package/dist/nile-popup/nile-popup.esm.js +2 -2
- package/dist/nile-progress-bar/index.cjs.js +1 -1
- package/dist/nile-progress-bar/index.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.cjs.js.map +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js.map +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.esm.js +2 -2
- package/dist/nile-radio/index.cjs.js +1 -1
- package/dist/nile-radio/index.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.css.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.css.cjs.js.map +1 -1
- package/dist/nile-radio/nile-radio.css.esm.js +1 -1
- package/dist/nile-radio/nile-radio.esm.js +2 -2
- package/dist/nile-radio-group/index.cjs.js +1 -1
- package/dist/nile-radio-group/index.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.css.cjs.js.map +1 -1
- package/dist/nile-radio-group/nile-radio-group.esm.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.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.css.cjs.js +1 -1
- package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.esm.js +1 -1
- package/dist/nile-select/nile-select.esm.js +2 -2
- package/dist/nile-sidebar/index.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/index.cjs.js +1 -1
- package/dist/nile-slide-toggle/index.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +2 -2
- package/dist/nile-spinner/index.cjs.js +1 -1
- package/dist/nile-spinner/index.esm.js +1 -1
- package/dist/nile-spinner/nile-spinner.cjs.js +1 -1
- package/dist/nile-spinner/nile-spinner.cjs.js.map +1 -1
- package/dist/nile-spinner/nile-spinner.css.cjs.js +1 -1
- package/dist/nile-spinner/nile-spinner.css.cjs.js.map +1 -1
- package/dist/nile-spinner/nile-spinner.css.esm.js +1 -1
- package/dist/nile-spinner/nile-spinner.esm.js +2 -2
- package/dist/nile-tag/index.cjs.js +1 -1
- package/dist/nile-tag/index.esm.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.css.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.css.esm.js +1 -1
- package/dist/nile-tag/nile-tag.esm.js +2 -2
- package/dist/nile-textarea/index.cjs.js +1 -1
- package/dist/nile-textarea/index.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.css.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.esm.js +2 -2
- package/dist/nile-toolbar/index.cjs.js +1 -1
- package/dist/nile-toolbar/index.cjs.js.map +1 -1
- package/dist/nile-toolbar/index.esm.js +1 -1
- package/dist/nile-toolbar/nile-toolbar.css.cjs.js +1 -1
- package/dist/nile-toolbar/nile-toolbar.css.cjs.js.map +1 -1
- package/dist/nile-toolbar/nile-toolbar.css.esm.js +1 -1
- package/dist/nile-tooltip/index.cjs.js +1 -1
- package/dist/nile-tooltip/index.esm.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.esm.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.esm.js +2 -2
- package/dist/{property-bf6307e2.esm.js → property-09139d3c.esm.js} +1 -1
- package/dist/property-0f6a51ec.cjs.js +6 -0
- package/dist/property-0f6a51ec.cjs.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/watch.d.ts +3 -3
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-badge/index.js.map +1 -1
- package/dist/src/nile-button/nile-button.js.map +1 -1
- package/dist/src/nile-calendar/index.d.ts +1 -0
- package/dist/src/nile-calendar/index.js +2 -0
- package/dist/src/nile-calendar/index.js.map +1 -0
- package/dist/src/nile-calendar/nile-calendar.css.d.ts +12 -0
- package/dist/src/nile-calendar/nile-calendar.css.js +186 -0
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -0
- package/dist/src/nile-calendar/nile-calendar.d.ts +70 -0
- package/dist/src/nile-calendar/nile-calendar.js +477 -0
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -0
- package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-date-picker/nile-date-picker.css.js +1 -1
- package/dist/src/nile-date-picker/nile-date-picker.css.js.map +1 -1
- package/dist/src/nile-date-picker/nile-date-picker.d.ts +1 -17
- package/dist/src/nile-date-picker/nile-date-picker.js +13 -317
- package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
- package/dist/src/nile-drawer/index.js.map +1 -1
- package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
- package/dist/src/nile-footer/index.js.map +1 -1
- package/dist/src/nile-form-error-message/nile-form-error-message.js.map +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
- package/dist/src/nile-heading/index.js.map +1 -1
- package/dist/src/nile-icon/index.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-loader/nile-loader.js +2 -2
- package/dist/src/nile-loader/nile-loader.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.js.map +1 -1
- package/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-popup/nile-popup.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/dist/src/nile-select/nile-select.js +1 -1
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-sidebar/index.js.map +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
- package/dist/src/nile-spinner/nile-spinner.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
- package/dist/src/nile-toolbar/index.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/dist/src/watch.d.ts +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/animation-registry.cjs.js.map +1 -1
- package/dist/watch.cjs.js +1 -1
- package/dist/watch.cjs.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/nile-calendar/index.ts +1 -0
- package/src/nile-calendar/nile-calendar.css.ts +188 -0
- package/src/nile-calendar/nile-calendar.ts +571 -0
- package/src/nile-date-picker/nile-date-picker.css.ts +1 -1
- package/src/nile-date-picker/nile-date-picker.ts +14 -381
- package/src/nile-loader/nile-loader.ts +2 -2
- package/src/nile-select/nile-select.ts +1 -1
- package/dist/index-adad7634.cjs.js +0 -22
- package/dist/index-adad7634.cjs.js.map +0 -1
- package/dist/index-f1b94546.esm.js +0 -35
- package/dist/property-ec52a751.cjs.js +0 -6
- package/dist/property-ec52a751.cjs.js.map +0 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";function _typeof(
|
1
|
+
System.register([],function(_export,_context){"use strict";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);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function e(e,n,o){return new Promise(function(i){if((o===null||o===void 0?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");var s=e.animate(n,_objectSpread(_objectSpread({},o),{},{duration:r()?0:o.duration}));s.addEventListener("cancel",i,{once:!0}),s.addEventListener("finish",i,{once:!0});});}function n(e){return(e=e.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(e):e.indexOf("s")>-1?1e3*parseFloat(e):parseFloat(e);}function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches;}function o(e){return Promise.all(e.getAnimations().map(function(e){return new Promise(function(n){var r=requestAnimationFrame(n);e.addEventListener("cancel",function(){return r;},{once:!0}),e.addEventListener("finish",function(){return r;},{once:!0}),e.cancel();});}));}_export({a:e,p:n,s:o});return{setters:[],execute:function(){}};});
|
2
2
|
//# sourceMappingURL=animate.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"animate.cjs.js","sources":["../../../src/internal/animate.ts"],"sourcesContent":["/**\n * Animates an element using keyframes. Returns a promise that resolves after the animation completes or gets canceled.\n */\nexport function animateTo(el: HTMLElement, keyframes: Keyframe[], options?: KeyframeAnimationOptions) {\n return new Promise(resolve => {\n if (options?.duration === Infinity) {\n throw new Error('Promise-based animations must be finite.');\n }\n\n const animation = el.animate(keyframes, {\n ...options,\n duration: prefersReducedMotion() ? 0 : options!.duration\n });\n\n animation.addEventListener('cancel', resolve, { once: true });\n animation.addEventListener('finish', resolve, { once: true });\n });\n}\n\n/** Parses a CSS duration and returns the number of milliseconds. */\nexport function parseDuration(delay: number | string) {\n delay = delay.toString().toLowerCase();\n\n if (delay.indexOf('ms') > -1) {\n return parseFloat(delay);\n }\n\n if (delay.indexOf('s') > -1) {\n return parseFloat(delay) * 1000;\n }\n\n return parseFloat(delay);\n}\n\n/** Tells if the user has enabled the \"reduced motion\" setting in their browser or OS. */\nexport function prefersReducedMotion() {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n return query.matches;\n}\n\n/**\n * Stops all active animations on the target element. Returns a promise that resolves after all animations are canceled.\n */\nexport function stopAnimations(el: HTMLElement) {\n return Promise.all(\n el.getAnimations().map(animation => {\n return new Promise(resolve => {\n const handleAnimationEvent = requestAnimationFrame(resolve);\n\n animation.addEventListener('cancel', () => handleAnimationEvent, { once: true });\n animation.addEventListener('finish', () => handleAnimationEvent, { once: true });\n animation.cancel();\n });\n })\n );\n}\n\n/**\n * We can't animate `height: auto`, but we can calculate the height and shim keyframes by replacing it with the\n * element's scrollHeight before the animation.\n */\nexport function shimKeyframesHeightAuto(keyframes: Keyframe[], calculatedHeight: number) {\n return keyframes.map(keyframe => ({\n ...keyframe,\n height: keyframe.height === 'auto' ? `${calculatedHeight}px` : keyframe.height\n }));\n}\n"],"names":["animateTo","el","keyframes","options","Promise","resolve","duration","Infinity","Error","animation","animate","prefersReducedMotion","addEventListener","once","parseDuration","delay","toString","toLowerCase","indexOf","parseFloat","window","matchMedia","matches","stopAnimations","all","getAnimations","map","handleAnimationEvent","requestAnimationFrame","cancel"],"mappings":"
|
1
|
+
{"version":3,"file":"animate.cjs.js","sources":["../../../src/internal/animate.ts"],"sourcesContent":["/**\n * Animates an element using keyframes. Returns a promise that resolves after the animation completes or gets canceled.\n */\nexport function animateTo(el: HTMLElement, keyframes: Keyframe[], options?: KeyframeAnimationOptions) {\n return new Promise(resolve => {\n if (options?.duration === Infinity) {\n throw new Error('Promise-based animations must be finite.');\n }\n\n const animation = el.animate(keyframes, {\n ...options,\n duration: prefersReducedMotion() ? 0 : options!.duration\n });\n\n animation.addEventListener('cancel', resolve, { once: true });\n animation.addEventListener('finish', resolve, { once: true });\n });\n}\n\n/** Parses a CSS duration and returns the number of milliseconds. */\nexport function parseDuration(delay: number | string) {\n delay = delay.toString().toLowerCase();\n\n if (delay.indexOf('ms') > -1) {\n return parseFloat(delay);\n }\n\n if (delay.indexOf('s') > -1) {\n return parseFloat(delay) * 1000;\n }\n\n return parseFloat(delay);\n}\n\n/** Tells if the user has enabled the \"reduced motion\" setting in their browser or OS. */\nexport function prefersReducedMotion() {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n return query.matches;\n}\n\n/**\n * Stops all active animations on the target element. Returns a promise that resolves after all animations are canceled.\n */\nexport function stopAnimations(el: HTMLElement) {\n return Promise.all(\n el.getAnimations().map(animation => {\n return new Promise(resolve => {\n const handleAnimationEvent = requestAnimationFrame(resolve);\n\n animation.addEventListener('cancel', () => handleAnimationEvent, { once: true });\n animation.addEventListener('finish', () => handleAnimationEvent, { once: true });\n animation.cancel();\n });\n })\n );\n}\n\n/**\n * We can't animate `height: auto`, but we can calculate the height and shim keyframes by replacing it with the\n * element's scrollHeight before the animation.\n */\nexport function shimKeyframesHeightAuto(keyframes: Keyframe[], calculatedHeight: number) {\n return keyframes.map(keyframe => ({\n ...keyframe,\n height: keyframe.height === 'auto' ? `${calculatedHeight}px` : keyframe.height\n }));\n}\n"],"names":["animateTo","el","keyframes","options","Promise","resolve","duration","Infinity","Error","animation","animate","prefersReducedMotion","addEventListener","once","parseDuration","delay","toString","toLowerCase","indexOf","parseFloat","r","window","matchMedia","matches","stopAnimations","all","getAnimations","map","handleAnimationEvent","requestAnimationFrame","cancel"],"mappings":"olDAGgBA,CAAAA,CAAAA,CAAUC,CAAiBC,CAAAA,CAAAA,CAAuBC,CAChE,CAAA,CAAA,MAAO,IAAIC,CAAAA,OAAQC,CAAAA,SAAAA,CAAAA,CAAAA,CACjB,GAAIF,CAAAA,CAAAA,SAAAA,CAAAA,iBAAAA,CAAAA,CAASG,QAAaC,IAAAA,CAAAA,CAAAA,CAAAA,CACxB,KAAM,IAAIC,CAAAA,KAAAA,CAAM,0CAGlB,CAAA,CAAA,GAAMC,CAAAA,CAAYR,CAAAA,CAAAA,CAAGS,OAAQR,CAAAA,CAAAA,CAAAA,aAAAA,CAAAA,aAAAA,IACxBC,CAAAA,MACHG,QAAUK,CAAAA,CAAAA,CAAAA,CAAAA,CAAyB,CAAIR,CAAAA,CAAAA,CAASG,YAGlDG,CAAUG,CAAAA,gBAAAA,CAAiB,QAAUP,CAAAA,CAAAA,CAAS,CAAEQ,IAAAA,CAAAA,CAAM,IACtDJ,CAAUG,CAAAA,gBAAAA,CAAiB,QAAUP,CAAAA,CAAAA,CAAS,CAAEQ,IAAAA,CAAAA,CAAM,GAAO,EAEjE,CAAA,EAGM,QAAUC,CAAAA,CAAAA,CAAcC,CAG5B,CAAA,CAAA,MAAA,CAFAA,CAAQA,CAAAA,CAAAA,CAAMC,QAAWC,CAAAA,CAAAA,CAAAA,WAAAA,CAAAA,CAAAA,EAEfC,OAAQ,CAAA,IAAA,CAAA,CAAA,CAAS,CAClBC,CAAAA,UAAAA,CAAWJ,GAGhBA,CAAMG,CAAAA,OAAAA,CAAQ,GAAQ,CAAA,CAAA,CAAA,CAAA,CACG,GAApBC,CAAAA,UAAAA,CAAWJ,GAGbI,UAAWJ,CAAAA,CAAAA,CACpB,UAGgBJ,CAAAA,CAEdS,CAAA,CAAA,CAAA,MADcC,CAAAA,OAAOC,UAAW,CAAA,kCAAA,CAAA,CACnBC,OACf,EAKM,QAAUC,CAAAA,CAAAA,CAAevB,CAC7B,CAAA,CAAA,MAAOG,CAAAA,OAAQqB,CAAAA,GAAAA,CACbxB,CAAGyB,CAAAA,aAAAA,CAAAA,CAAAA,CAAgBC,GAAIlB,CAAAA,SAAAA,CAAAA,QACd,IAAIL,CAAAA,OAAQC,CAAAA,SAAAA,CAAAA,CAAAA,CACjB,GAAMuB,CAAAA,CAAAA,CAAuBC,qBAAsBxB,CAAAA,CAAAA,CAAAA,CAEnDI,CAAUG,CAAAA,gBAAAA,CAAiB,QAAU,CAAA,iBAAMgB,CAAAA,CAAsB,GAAA,CAAEf,IAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CACzEJ,EAAUG,gBAAiB,CAAA,QAAA,CAAU,iBAAMgB,CAAAA,CAAAA,GAAsB,CAAEf,IAAAA,CAAAA,CAAM,CACzEJ,CAAAA,CAAAA,CAAAA,CAAAA,CAAUqB,MAAQ,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAI1B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"default-value.cjs.js","sources":["../../../src/internal/default-value.ts"],"sourcesContent":["// @defaultValue decorator\n//\n// Runs when the corresponding attribute of the observed property changes, e.g. after calling Element.setAttribute or after updating\n// the observed property.\n//\n// The decorator checks whether the value of the attribute is different from the value of the property and in that case\n// it saves the new value.\n//\n//\n// Usage:\n//\n// @property({ type: Boolean, reflect: true }) checked = false;\n//\n// @defaultValue('checked') defaultChecked = false;\n//\n\nimport { defaultConverter } from 'lit';\nimport type { ReactiveElement } from 'lit';\n\nexport const defaultValue =\n (propertyName = 'value') =>\n (proto: ReactiveElement, key: string) => {\n const ctor = proto.constructor as typeof ReactiveElement;\n\n const attributeChangedCallback = ctor.prototype.attributeChangedCallback;\n ctor.prototype.attributeChangedCallback = function (\n this: ReactiveElement & { [name: string]: unknown },\n name,\n old,\n value\n ) {\n const options = ctor.getPropertyOptions(propertyName);\n const attributeName = typeof options.attribute === 'string' ? options.attribute : propertyName;\n\n if (name === attributeName) {\n const converter = options.converter || defaultConverter;\n const fromAttribute =\n typeof converter === 'function' ? converter : converter?.fromAttribute ?? defaultConverter.fromAttribute;\n\n const newValue: unknown = fromAttribute!(value, options.type);\n\n if (this[propertyName] !== newValue) {\n this[key] = newValue;\n }\n }\n\n attributeChangedCallback.call(this, name, old, value);\n };\n };\n"],"names":["defaultValue","propertyName","proto","key","ctor","constructor","attributeChangedCallback","prototype","name","old","value","options","getPropertyOptions","attribute","converter","defaultConverter","newValue","fromAttribute","type","this","call"],"mappings":"iKAmBaA,CACX,CAAA,
|
1
|
+
{"version":3,"file":"default-value.cjs.js","sources":["../../../src/internal/default-value.ts"],"sourcesContent":["// @defaultValue decorator\n//\n// Runs when the corresponding attribute of the observed property changes, e.g. after calling Element.setAttribute or after updating\n// the observed property.\n//\n// The decorator checks whether the value of the attribute is different from the value of the property and in that case\n// it saves the new value.\n//\n//\n// Usage:\n//\n// @property({ type: Boolean, reflect: true }) checked = false;\n//\n// @defaultValue('checked') defaultChecked = false;\n//\n\nimport { defaultConverter } from 'lit';\nimport type { ReactiveElement } from 'lit';\n\nexport const defaultValue =\n (propertyName = 'value') =>\n (proto: ReactiveElement, key: string) => {\n const ctor = proto.constructor as typeof ReactiveElement;\n\n const attributeChangedCallback = ctor.prototype.attributeChangedCallback;\n ctor.prototype.attributeChangedCallback = function (\n this: ReactiveElement & { [name: string]: unknown },\n name,\n old,\n value\n ) {\n const options = ctor.getPropertyOptions(propertyName);\n const attributeName = typeof options.attribute === 'string' ? options.attribute : propertyName;\n\n if (name === attributeName) {\n const converter = options.converter || defaultConverter;\n const fromAttribute =\n typeof converter === 'function' ? converter : converter?.fromAttribute ?? defaultConverter.fromAttribute;\n\n const newValue: unknown = fromAttribute!(value, options.type);\n\n if (this[propertyName] !== newValue) {\n this[key] = newValue;\n }\n }\n\n attributeChangedCallback.call(this, name, old, value);\n };\n };\n"],"names":["defaultValue","o","propertyName","proto","key","ctor","constructor","attributeChangedCallback","prototype","name","old","value","options","getPropertyOptions","attribute","_i$fromAttribute","converter","defaultConverter","newValue","fromAttribute","type","this","call"],"mappings":"iKAmBaA,CACX,CAAA,SAAAC,EAAA,KAACC,CAAAA,4DAAe,OAChB,OAAA,UAACC,CAAwBC,CAAAA,CAAAA,CAAAA,CACvB,GAAMC,CAAAA,CAAAA,CAAOF,CAAMG,CAAAA,WAAAA,CAEbC,EAA2BF,CAAKG,CAAAA,SAAAA,CAAUD,wBAChDF,CAAAA,CAAAA,CAAKG,SAAUD,CAAAA,wBAAAA,CAA2B,SAExCE,CAAAA,CACAC,EACAC,CAEA,CAAA,CAAA,GAAMC,CAAAA,CAAUP,CAAAA,CAAAA,CAAKQ,kBAAmBX,CAAAA,CAAAA,CAAAA,CAGxC,GAAIO,CAAAA,IAF+C,gBAAtBG,CAAAA,CAAQE,CAAAA,SAAAA,CAAyBF,CAAQE,CAAAA,SAAAA,CAAYZ,CAEtD,CAAA,CAAA,KAAAa,gBAAA,CAC1B,GAAMC,CAAAA,EAAAA,CAAYJ,EAAQI,SAAaC,EAAAA,CAAAA,CAIjCC,EAFiB,CAAA,CAAA,UAAA,EAAA,MAAdF,CAAAA,EAA2BA,CAAAA,EAAAA,EAAAA,gBAAAA,CAAYA,EAAWG,SAAXH,EAAWG,iBAAXH,EAAWG,CAAAA,aAAAA,UAAAA,gBAAAA,UAAAA,gBAAAA,CAAiBF,EAAiBE,aAEpDR,EAAAA,CAAAA,CAAOC,CAAQQ,CAAAA,IAAAA,CAAAA,CAEpDC,IAAKnB,CAAAA,CAAAA,CAAAA,GAAkBgB,EACzBG,GAAAA,IAAAA,CAAKjB,GAAOc,EAEf,CAAA,EAEDX,CAAyBe,CAAAA,IAAAA,CAAKD,IAAMZ,CAAAA,CAAAA,CAAMC,CAAKC,CAAAA,CAAAA,CACjD,EAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"event.cjs.js","sources":["../../../src/internal/event.ts"],"sourcesContent":["/** Waits for a specific event to be emitted from an element. Ignores events that bubble up from child elements. */\nexport function waitForEvent(el: HTMLElement, eventName: string) {\n return new Promise<void>(resolve => {\n function done(event: Event) {\n if (event.target === el) {\n el.removeEventListener(eventName, done);\n resolve();\n }\n }\n\n el.addEventListener(eventName, done);\n });\n}\n"],"names":["waitForEvent","el","eventName","Promise","resolve","addEventListener","done","event","target","removeEventListener"],"mappings":"2DACgB,QAAAA,
|
1
|
+
{"version":3,"file":"event.cjs.js","sources":["../../../src/internal/event.ts"],"sourcesContent":["/** Waits for a specific event to be emitted from an element. Ignores events that bubble up from child elements. */\nexport function waitForEvent(el: HTMLElement, eventName: string) {\n return new Promise<void>(resolve => {\n function done(event: Event) {\n if (event.target === el) {\n el.removeEventListener(eventName, done);\n resolve();\n }\n }\n\n el.addEventListener(eventName, done);\n });\n}\n"],"names":["waitForEvent","el","eventName","Promise","resolve","addEventListener","done","event","target","removeEventListener"],"mappings":"2DACgB,QAAAA,CAAAA,CAAAA,CAAaC,EAAiBC,CAC5C,CAAA,CAAA,MAAO,IAAIC,CAAAA,OAAcC,CAAAA,SAAAA,CAAAA,CAAAA,CAQvBH,CAAGI,CAAAA,gBAAAA,CAAiBH,CAPpB,CAAA,QAASI,CAAAA,EAAKC,CACRA,CAAAA,CAAAA,CAAAA,CAAMC,MAAWP,GAAAA,CAAAA,GACnBA,CAAGQ,CAAAA,mBAAAA,CAAoBP,EAAWI,CAClCF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAEH,EAEmC,CAAA,EAAA,CAExC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";var t,i,s,h,e,o;function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function(){};return{s:F,n:function(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function(e){throw e;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function(){it=it.call(o);},n:function(){var step=it.next();normalCompletion=step.done;return step;},e:function(e){didErr=true;err=e;},f:function(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}return{setters:[],execute:function(){t=new WeakMap();i=new WeakMap();s=new WeakSet();h=new WeakMap();_export("F",e=/*#__PURE__*/function(){function e(t,i){_classCallCheck(this,e);(this.host=t).addController(this),this.options=_objectSpread({form:function form(t){if(t.hasAttribute("form")&&""!==t.getAttribute("form")){var _i=t.getRootNode(),_s=t.getAttribute("form");if(_s)return _i.getElementById(_s);}return t.closest("form");},name:function name(t){return t.name;},value:function value(t){return t.value;},defaultValue:function defaultValue(t){return t.defaultValue;},disabled:function disabled(t){var _t$disabled;return(_t$disabled=t.disabled)!==null&&_t$disabled!==void 0?_t$disabled:!1;},reportValidity:function reportValidity(t){return"function"!=typeof t.reportValidity||t.reportValidity();},setValue:function setValue(t,i){return t.value=i;},assumeInteractionOn:["nile-input"]},i),this.handleFormData=this.handleFormData.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleFormReset=this.handleFormReset.bind(this),this.reportFormValidity=this.reportFormValidity.bind(this),this.handleInteraction=this.handleInteraction.bind(this);}_createClass(e,[{key:"hostConnected",value:function hostConnected(){var _this=this;var t=this.options.form(this.host);t&&this.attachForm(t),h.set(this.host,[]),this.options.assumeInteractionOn.forEach(function(t){_this.host.addEventListener(t,_this.handleInteraction);});}},{key:"hostDisconnected",value:function hostDisconnected(){var _this2=this;this.detachForm(),h["delete"](this.host),this.options.assumeInteractionOn.forEach(function(t){_this2.host.removeEventListener(t,_this2.handleInteraction);});}},{key:"hostUpdated",value:function hostUpdated(){var t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid);}},{key:"attachForm",value:function attachForm(s){var _this3=this;s?(this.form=s,t.has(this.form)?t.get(this.form).add(this.host):t.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),i.has(this.form)||(i.set(this.form,this.form.reportValidity),this.form.reportValidity=function(){return _this3.reportFormValidity();})):this.form=void 0;}},{key:"detachForm",value:function detachForm(){var _t$get;this.form&&((_t$get=t.get(this.form))!==null&&_t$get!==void 0&&_t$get["delete"](this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),i.has(this.form)&&(this.form.reportValidity=i.get(this.form),i["delete"](this.form))),this.form=void 0;}},{key:"handleFormData",value:function handleFormData(t){var i=this.options.disabled(this.host),s=this.options.name(this.host),h=this.options.value(this.host),_e="nile-button"===this.host.tagName.toLowerCase();!i&&!_e&&"string"==typeof s&&s.length>0&&void 0!==h&&(Array.isArray(h)?h.forEach(function(i){t.formData.append(s,i.toString());}):t.formData.append(s,h.toString()));}},{key:"handleFormSubmit",value:function handleFormSubmit(i){var _t$get2,_this4=this;var s=this.options.disabled(this.host),h=this.options.reportValidity;this.form&&!this.form.noValidate&&(_t$get2=t.get(this.form))!==null&&_t$get2!==void 0&&_t$get2.forEach(function(t){_this4.setUserInteracted(t,!0);}),!this.form||this.form.noValidate||s||h(this.host)||(i.preventDefault(),i.stopImmediatePropagation());}},{key:"handleFormReset",value:function handleFormReset(){this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),h.set(this.host,[]);}},{key:"handleInteraction",value:function handleInteraction(t){var i=h.get(this.host);i.includes(t.type)||i.push(t.type),i.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0);}},{key:"reportFormValidity",value:function reportFormValidity(){if(this.form&&!this.form.noValidate){var _t=this.form.querySelectorAll("*");var _iterator=_createForOfIteratorHelper(_t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i2=_step.value;if("function"==typeof _i2.reportValidity&&!_i2.reportValidity())return!1;}}catch(err){_iterator.e(err);}finally{_iterator.f();}}return!0;}},{key:"setUserInteracted",value:function setUserInteracted(t,i){i?s.add(t):s["delete"](t),t.requestUpdate();}},{key:"doAction",value:function doAction(t,i){if(this.form){var _s2=document.createElement("button");_s2.type=t,_s2.style.position="absolute",_s2.style.width="0",_s2.style.height="0",_s2.style.clipPath="inset(50%)",_s2.style.overflow="hidden",_s2.style.whiteSpace="nowrap",i&&(_s2.name=i.name,_s2.value=i.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(function(t){i.hasAttribute(t)&&_s2.setAttribute(t,i.getAttribute(t));})),this.form.append(_s2),_s2.click(),_s2.remove();}}},{key:"getForm",value:function getForm(){var _this$form;return(_this$form=this.form)!==null&&_this$form!==void 0?_this$form:null;}},{key:"reset",value:function reset(t){this.doAction("reset",t);}},{key:"submit",value:function submit(t){this.doAction("submit",t);}},{key:"setValidity",value:function setValidity(t){var i=this.host,h=Boolean(s.has(i)),_e2=Boolean(i.required);i.toggleAttribute("data-required",_e2),i.toggleAttribute("data-optional",!_e2),i.toggleAttribute("data-invalid",!t),i.toggleAttribute("data-valid",t),i.toggleAttribute("data-user-invalid",!t&&h),i.toggleAttribute("data-user-valid",t&&h);}},{key:"updateValidity",value:function updateValidity(){var t=this.host;this.setValidity(t.validity.valid);}},{key:"emitInvalidEvent",value:function emitInvalidEvent(t){var i=new CustomEvent("nile-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||i.preventDefault(),this.host.dispatchEvent(i)||(t===null||t===void 0?void 0:t.preventDefault());}}]);return e;}());_export("v",o=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}));Object.freeze(_objectSpread(_objectSpread({},o),{},{valid:!1,valueMissing:!0})),Object.freeze(_objectSpread(_objectSpread({},o),{},{valid:!1,customError:!0}));}};});
|
1
|
+
System.register([],function(_export,_context){"use strict";var t,i,s,h,e,o;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);}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function(){};return{s:F,n:function(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function(e){throw e;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function(){it=it.call(o);},n:function(){var step=it.next();normalCompletion=step.done;return step;},e:function(e){didErr=true;err=e;},f:function(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}return{setters:[],execute:function(){t=new WeakMap();i=new WeakMap();s=new WeakSet();h=new WeakMap();_export("F",e=/*#__PURE__*/function(){function e(t,i){_classCallCheck(this,e);(this.host=t).addController(this),this.options=_objectSpread({form:function form(t){if(t.hasAttribute("form")&&""!==t.getAttribute("form")){var _i=t.getRootNode(),_s=t.getAttribute("form");if(_s)return _i.getElementById(_s);}return t.closest("form");},name:function name(t){return t.name;},value:function value(t){return t.value;},defaultValue:function defaultValue(t){return t.defaultValue;},disabled:function disabled(t){var _t$disabled;return(_t$disabled=t.disabled)!==null&&_t$disabled!==void 0?_t$disabled:!1;},reportValidity:function reportValidity(t){return"function"!=typeof t.reportValidity||t.reportValidity();},setValue:function setValue(t,i){return t.value=i;},assumeInteractionOn:["nile-input"]},i),this.handleFormData=this.handleFormData.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleFormReset=this.handleFormReset.bind(this),this.reportFormValidity=this.reportFormValidity.bind(this),this.handleInteraction=this.handleInteraction.bind(this);}_createClass(e,[{key:"hostConnected",value:function hostConnected(){var _this=this;var t=this.options.form(this.host);t&&this.attachForm(t),h.set(this.host,[]),this.options.assumeInteractionOn.forEach(function(t){_this.host.addEventListener(t,_this.handleInteraction);});}},{key:"hostDisconnected",value:function hostDisconnected(){var _this2=this;this.detachForm(),h["delete"](this.host),this.options.assumeInteractionOn.forEach(function(t){_this2.host.removeEventListener(t,_this2.handleInteraction);});}},{key:"hostUpdated",value:function hostUpdated(){var t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid);}},{key:"attachForm",value:function attachForm(s){var _this3=this;s?(this.form=s,t.has(this.form)?t.get(this.form).add(this.host):t.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),i.has(this.form)||(i.set(this.form,this.form.reportValidity),this.form.reportValidity=function(){return _this3.reportFormValidity();})):this.form=void 0;}},{key:"detachForm",value:function detachForm(){var _t$get;this.form&&((_t$get=t.get(this.form))!==null&&_t$get!==void 0&&_t$get["delete"](this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),i.has(this.form)&&(this.form.reportValidity=i.get(this.form),i["delete"](this.form))),this.form=void 0;}},{key:"handleFormData",value:function handleFormData(t){var i=this.options.disabled(this.host),s=this.options.name(this.host),h=this.options.value(this.host),_e="nile-button"===this.host.tagName.toLowerCase();!i&&!_e&&"string"==typeof s&&s.length>0&&void 0!==h&&(Array.isArray(h)?h.forEach(function(i){t.formData.append(s,i.toString());}):t.formData.append(s,h.toString()));}},{key:"handleFormSubmit",value:function handleFormSubmit(i){var _t$get2,_this4=this;var s=this.options.disabled(this.host),h=this.options.reportValidity;this.form&&!this.form.noValidate&&(_t$get2=t.get(this.form))!==null&&_t$get2!==void 0&&_t$get2.forEach(function(t){_this4.setUserInteracted(t,!0);}),!this.form||this.form.noValidate||s||h(this.host)||(i.preventDefault(),i.stopImmediatePropagation());}},{key:"handleFormReset",value:function handleFormReset(){this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),h.set(this.host,[]);}},{key:"handleInteraction",value:function handleInteraction(t){var i=h.get(this.host);i.includes(t.type)||i.push(t.type),i.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0);}},{key:"reportFormValidity",value:function reportFormValidity(){if(this.form&&!this.form.noValidate){var _t=this.form.querySelectorAll("*");var _iterator=_createForOfIteratorHelper(_t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i2=_step.value;if("function"==typeof _i2.reportValidity&&!_i2.reportValidity())return!1;}}catch(err){_iterator.e(err);}finally{_iterator.f();}}return!0;}},{key:"setUserInteracted",value:function setUserInteracted(t,i){i?s.add(t):s["delete"](t),t.requestUpdate();}},{key:"doAction",value:function doAction(t,i){if(this.form){var _s2=document.createElement("button");_s2.type=t,_s2.style.position="absolute",_s2.style.width="0",_s2.style.height="0",_s2.style.clipPath="inset(50%)",_s2.style.overflow="hidden",_s2.style.whiteSpace="nowrap",i&&(_s2.name=i.name,_s2.value=i.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(function(t){i.hasAttribute(t)&&_s2.setAttribute(t,i.getAttribute(t));})),this.form.append(_s2),_s2.click(),_s2.remove();}}},{key:"getForm",value:function getForm(){var _this$form;return(_this$form=this.form)!==null&&_this$form!==void 0?_this$form:null;}},{key:"reset",value:function reset(t){this.doAction("reset",t);}},{key:"submit",value:function submit(t){this.doAction("submit",t);}},{key:"setValidity",value:function setValidity(t){var i=this.host,h=Boolean(s.has(i)),_e2=Boolean(i.required);i.toggleAttribute("data-required",_e2),i.toggleAttribute("data-optional",!_e2),i.toggleAttribute("data-invalid",!t),i.toggleAttribute("data-valid",t),i.toggleAttribute("data-user-invalid",!t&&h),i.toggleAttribute("data-user-valid",t&&h);}},{key:"updateValidity",value:function updateValidity(){var t=this.host;this.setValidity(t.validity.valid);}},{key:"emitInvalidEvent",value:function emitInvalidEvent(t){var i=new CustomEvent("nile-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||i.preventDefault(),this.host.dispatchEvent(i)||(t===null||t===void 0?void 0:t.preventDefault());}}]);return e;}());_export("v",o=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}));Object.freeze(_objectSpread(_objectSpread({},o),{},{valid:!1,valueMissing:!0})),Object.freeze(_objectSpread(_objectSpread({},o),{},{valid:!1,customError:!0}));}};});
|
2
2
|
//# sourceMappingURL=form.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"form.cjs.js","sources":["../../../src/internal/form.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { NileFormControl } from '../internal/nile-element';\nimport type { NileButton } from '../nile-button';\n\n//\n// We store a WeakMap of forms + controls so we can keep references to all Nile controls within a given form. As\n// elements connect and disconnect to/from the DOM, their containing form is used as the key and the form control is\n// added and removed from the form's set, respectively.\n//\nexport const formCollections: WeakMap<HTMLFormElement, Set<NileFormControl>> = new WeakMap();\n\n//\n// We store a WeakMap of reportValidity() overloads so we can override it when form controls connect to the DOM and\n// restore the original behavior when they disconnect.\n//\nconst reportValidityOverloads: WeakMap<HTMLFormElement, () => boolean> = new WeakMap();\n\n//\n// We store a Set of controls that users have interacted with. This allows us to determine the interaction state\n// without littering the DOM with additional data attributes.\n//\nconst userInteractedControls: WeakSet<NileFormControl> = new WeakSet();\n\n//\n// We store a WeakMap of interactions for each form control so we can track when all conditions are met for validation.\n//\nconst interactions = new WeakMap<NileFormControl, string[]>();\n\nexport interface FormControlControllerOptions {\n /** A function that returns the form containing the form control. */\n form: (input: NileFormControl) => HTMLFormElement | null;\n /** A function that returns the form control's name, which will be submitted with the form data. */\n name: (input: NileFormControl) => string;\n /** A function that returns the form control's current value. */\n value: (input: NileFormControl) => unknown | unknown[];\n /** A function that returns the form control's default value. */\n defaultValue: (input: NileFormControl) => unknown | unknown[];\n /** A function that returns the form control's current disabled state. If disabled, the value won't be submitted. */\n disabled: (input: NileFormControl) => boolean;\n /**\n * A function that maps to the form control's reportValidity() function. When the control is invalid, this will\n * prevent submission and trigger the browser's constraint violation warning.\n */\n reportValidity: (input: NileFormControl) => boolean;\n /** A function that sets the form control's value */\n setValue: (input: NileFormControl, value: unknown) => void;\n /**\n * An array of event names to listen to. When all events in the list are emitted, the control will receive validity\n * states such as user-valid and user-invalid.user interacted validity states. */\n assumeInteractionOn: string[];\n}\n\n/** A reactive controller to allow form controls to participate in form submission, validation, etc. */\nexport class FormControlController implements ReactiveController {\n host: NileFormControl & ReactiveControllerHost;\n form?: HTMLFormElement | null;\n options: FormControlControllerOptions;\n\n constructor(host: ReactiveControllerHost & NileFormControl, options?: Partial<FormControlControllerOptions>) {\n (this.host = host).addController(this);\n this.options = {\n form: input => {\n // If there's a form attribute, use it to find the target form by id\n if (input.hasAttribute('form') && input.getAttribute('form') !== '') {\n const root = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute('form');\n\n if (formId) {\n return root.getElementById(formId) as HTMLFormElement;\n }\n }\n\n return input.closest('form');\n },\n name: input => input.name,\n value: input => input.value,\n defaultValue: input => input.defaultValue,\n disabled: input => input.disabled ?? false,\n reportValidity: input => (typeof input.reportValidity === 'function' ? input.reportValidity() : true),\n setValue: (input, value: string) => (input.value = value),\n assumeInteractionOn: ['nile-input'],\n ...options\n };\n this.handleFormData = this.handleFormData.bind(this);\n this.handleFormSubmit = this.handleFormSubmit.bind(this);\n this.handleFormReset = this.handleFormReset.bind(this);\n this.reportFormValidity = this.reportFormValidity.bind(this);\n this.handleInteraction = this.handleInteraction.bind(this);\n }\n\n hostConnected() {\n const form = this.options.form(this.host);\n\n if (form) {\n this.attachForm(form);\n }\n\n // Listen for interactions\n interactions.set(this.host, []);\n this.options.assumeInteractionOn.forEach(event => {\n this.host.addEventListener(event, this.handleInteraction);\n });\n }\n\n hostDisconnected() {\n this.detachForm();\n\n // Clean up interactions\n interactions.delete(this.host);\n this.options.assumeInteractionOn.forEach(event => {\n this.host.removeEventListener(event, this.handleInteraction);\n });\n }\n\n hostUpdated() {\n const form = this.options.form(this.host);\n\n // Detach if the form no longer exists\n if (!form) {\n this.detachForm();\n }\n\n // If the form has changed, reattach it\n if (form && this.form !== form) {\n this.detachForm();\n this.attachForm(form);\n }\n\n if (this.host.hasUpdated) {\n this.setValidity(this.host.validity.valid);\n }\n }\n\n private attachForm(form?: HTMLFormElement) {\n if (form) {\n this.form = form;\n\n // Add this element to the form's collection\n if (formCollections.has(this.form)) {\n formCollections.get(this.form)!.add(this.host);\n } else {\n formCollections.set(this.form, new Set<NileFormControl>([this.host]));\n }\n\n this.form.addEventListener('formdata', this.handleFormData);\n this.form.addEventListener('submit', this.handleFormSubmit);\n this.form.addEventListener('reset', this.handleFormReset);\n\n // Overload the form's reportValidity() method so it looks at nile form controls\n if (!reportValidityOverloads.has(this.form)) {\n reportValidityOverloads.set(this.form, this.form.reportValidity);\n this.form.reportValidity = () => this.reportFormValidity();\n }\n } else {\n this.form = undefined;\n }\n }\n\n private detachForm() {\n if (this.form) {\n // Remove this element from the form's collection\n formCollections.get(this.form)?.delete(this.host);\n\n this.form.removeEventListener('formdata', this.handleFormData);\n this.form.removeEventListener('submit', this.handleFormSubmit);\n this.form.removeEventListener('reset', this.handleFormReset);\n\n // Remove the overload and restore the original method\n if (reportValidityOverloads.has(this.form)) {\n this.form.reportValidity = reportValidityOverloads.get(this.form)!;\n reportValidityOverloads.delete(this.form);\n }\n }\n\n this.form = undefined;\n }\n\n private handleFormData(event: FormDataEvent) {\n const disabled = this.options.disabled(this.host);\n const name = this.options.name(this.host);\n const value = this.options.value(this.host);\n\n // For buttons, we only submit the value if they were the submitter. This is currently done in doAction() by\n // injecting the name/value on a temporary button, so we can just skip them here.\n const isButton = this.host.tagName.toLowerCase() === 'nile-button';\n\n if (!disabled && !isButton && typeof name === 'string' && name.length > 0 && typeof value !== 'undefined') {\n if (Array.isArray(value)) {\n (value as unknown[]).forEach(val => {\n event.formData.append(name, (val as string | number | boolean).toString());\n });\n } else {\n event.formData.append(name, (value as string | number | boolean).toString());\n }\n }\n }\n\n private handleFormSubmit(event: Event) {\n const disabled = this.options.disabled(this.host);\n const reportValidity = this.options.reportValidity;\n\n // Update the interacted state for all controls when the form is submitted\n if (this.form && !this.form.noValidate) {\n formCollections.get(this.form)?.forEach(control => {\n this.setUserInteracted(control, true);\n });\n }\n\n if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n private handleFormReset() {\n this.options.setValue(this.host, this.options.defaultValue(this.host));\n this.setUserInteracted(this.host, false);\n interactions.set(this.host, []);\n }\n\n private handleInteraction(event: Event) {\n const emittedEvents = interactions.get(this.host)!;\n\n if (!emittedEvents.includes(event.type)) {\n emittedEvents.push(event.type);\n }\n\n // Mark it as user-interacted as soon as all associated events have been emitted\n if (emittedEvents.length === this.options.assumeInteractionOn.length) {\n this.setUserInteracted(this.host, true);\n }\n }\n\n private reportFormValidity() {\n //\n // Nile form controls work hard to act like regular form controls. They support the Constraint Validation API\n // and its associated methods such as setCustomValidity() and reportValidity(). However, the HTMLFormElement also\n // has a reportValidity() method that will trigger validation on all child controls. Since we're not yet using\n // ElementInternals, we need to overload this method so it looks for any element with the reportValidity() method.\n //\n // We preserve the original method in a WeakMap, but we don't call it from the overload because that would trigger\n // validations in an unexpected order. When the element disconnects, we revert to the original behavior. This won't\n // be necessary once we can use ElementInternals.\n //\n // Note that we're also honoring the form's novalidate attribute.\n //\n if (this.form && !this.form.noValidate) {\n // This seems sloppy, but checking all elements will cover native inputs, Nile inputs, and other custom\n // elements that support the constraint validation API.\n const elements = this.form.querySelectorAll<HTMLInputElement>('*');\n\n for (const element of elements) {\n if (typeof element.reportValidity === 'function') {\n if (!element.reportValidity()) {\n return false;\n }\n }\n }\n }\n\n return true;\n }\n\n private setUserInteracted(el: NileFormControl, hasInteracted: boolean) {\n if (hasInteracted) {\n userInteractedControls.add(el);\n } else {\n userInteractedControls.delete(el);\n }\n\n el.requestUpdate();\n }\n\n private doAction(type: 'submit' | 'reset', submitter?: HTMLInputElement | NileButton) {\n if (this.form) {\n const button = document.createElement('button');\n button.type = type;\n button.style.position = 'absolute';\n button.style.width = '0';\n button.style.height = '0';\n button.style.clipPath = 'inset(50%)';\n button.style.overflow = 'hidden';\n button.style.whiteSpace = 'nowrap';\n\n // Pass name, value, and form attributes through to the temporary button\n if (submitter) {\n button.name = submitter.name;\n button.value = submitter.value;\n\n ['formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach(attr => {\n if (submitter.hasAttribute(attr)) {\n button.setAttribute(attr, submitter.getAttribute(attr)!);\n }\n });\n }\n\n this.form.append(button);\n button.click();\n button.remove();\n }\n }\n\n /** Returns the associated `<form>` element, if one exists. */\n getForm() {\n return this.form ?? null;\n }\n\n /** Resets the form, restoring all the control to their default value */\n reset(submitter?: HTMLInputElement | NileButton) {\n this.doAction('reset', submitter);\n }\n\n /** Submits the form, triggering validation and form data injection. */\n submit(submitter?: HTMLInputElement | NileButton) {\n // Calling form.submit() bypasses the submit event and constraint validation. To prevent this, we can inject a\n // native submit button into the form, \"click\" it, then remove it to simulate a standard form submission.\n this.doAction('submit', submitter);\n }\n\n /**\n * Synchronously sets the form control's validity. Call this when you know the future validity but need to update\n * the host element immediately, i.e. before Lit updates the component in the next update.\n */\n setValidity(isValid: boolean) {\n const host = this.host;\n const hasInteracted = Boolean(userInteractedControls.has(host));\n const required = Boolean(host.required);\n\n //\n // We're mapping the following \"states\" to data attributes. In the future, we can use ElementInternals.states to\n // create a similar mapping, but instead of [data-invalid] it will look like :--invalid.\n //\n //\n host.toggleAttribute('data-required', required);\n host.toggleAttribute('data-optional', !required);\n host.toggleAttribute('data-invalid', !isValid);\n host.toggleAttribute('data-valid', isValid);\n host.toggleAttribute('data-user-invalid', !isValid && hasInteracted);\n host.toggleAttribute('data-user-valid', isValid && hasInteracted);\n }\n\n /**\n * Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything\n * that affects constraint validation changes so the component receives the correct validity states.\n */\n updateValidity() {\n const host = this.host;\n this.setValidity(host.validity.valid);\n }\n\n /**\n * Dispatches a non-bubbling, cancelable custom event of type `nile-invalid`.\n * If the `nile-invalid` event will be cancelled then the original `invalid`\n * event (which may have been passed as argument) will also be cancelled.\n * If no original `invalid` event has been passed then the `nile-invalid`\n * event will be cancelled before being dispatched.\n */\n emitInvalidEvent(originalInvalidEvent?: Event) {\n const slInvalidEvent = new CustomEvent<Record<PropertyKey, never>>('nile-invalid', {\n bubbles: false,\n composed: false,\n cancelable: true,\n detail: {}\n });\n\n if (!originalInvalidEvent) {\n slInvalidEvent.preventDefault();\n }\n\n if (!this.host.dispatchEvent(slInvalidEvent)) {\n originalInvalidEvent?.preventDefault();\n }\n }\n}\n\n/*\n * Predefined common validity states.\n * All of them are read-only.\n */\n\n// A validity state object that represents `valid`\nexport const validValidityState: ValidityState = Object.freeze({\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: true,\n valueMissing: false\n});\n\n// A validity state object that represents `value missing`\nexport const valueMissingValidityState: ValidityState = Object.freeze({\n ...validValidityState,\n valid: false,\n valueMissing: true\n});\n\n// A validity state object that represents a custom error\nexport const customErrorValidityState: ValidityState = Object.freeze({\n ...validValidityState,\n valid: false,\n customError: true\n});\n"],"names":["formCollections","WeakMap","reportValidityOverloads","userInteractedControls","WeakSet","interactions","FormControlController","constructor","host","options","this","addController","form","input","hasAttribute","getAttribute","root","getRootNode","formId","getElementById","closest","name","value","defaultValue","disabled","reportValidity","setValue","assumeInteractionOn","handleFormData","bind","handleFormSubmit","handleFormReset","reportFormValidity","handleInteraction","hostConnected","attachForm","set","forEach","event","addEventListener","hostDisconnected","detachForm","delete","removeEventListener","hostUpdated","hasUpdated","setValidity","validity","valid","has","get","add","Set","undefined","isButton","tagName","toLowerCase","length","Array","isArray","val","formData","append","toString","noValidate","control","setUserInteracted","preventDefault","stopImmediatePropagation","emittedEvents","includes","type","push","elements","querySelectorAll","element","el","hasInteracted","requestUpdate","doAction","submitter","button","document","createElement","style","position","width","height","clipPath","overflow","whiteSpace","attr","setAttribute","click","remove","getForm","reset","submit","isValid","Boolean","required","toggleAttribute","updateValidity","emitInvalidEvent","originalInvalidEvent","slInvalidEvent","CustomEvent","bubbles","composed","cancelable","detail","dispatchEvent","validValidityState","Object","freeze","badInput","customError","patternMismatch","range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AAA,IAAAA,CAClBE,KAAKoC,WAAYtC,CAAAA,CAAAA,CAAKuC,SAASC,KAChC,CAAA,EASDuD,0DAAiBC,CACf,CAAA,CAAA,GAAMC,EAAiB,CAAA,GAAIC,aAAwC,cAAgB,CAAA,CACjFC,SAAS,CACTC,CAAAA,QAAAA,CAAAA,CAAU,EACVC,UAAY,CAAA,CAAA,CAAA,CACZC,OAAQ,CAAE,CAAA,CAAA,CAAA,CAGPN,GACHC,CAAetC,CAAAA,cAAAA,EAAAA,CAGZzD,KAAKF,IAAKuG,CAAAA,aAAAA,CAAcN,KAC3BD,CAAsBrC,SAAtBqC,CAAsBrC,iBAAtBqC,CAAsBrC,CAAAA,cAAAA,EAEzB,GASU,8BAAA6C,EAAoCC,MAAOC,CAAAA,MAAAA,CAAO,CAC7DC,QAAU,CAAA,CAAA,CAAA,CACVC,aAAa,CACbC,CAAAA,eAAAA,CAAAA,CAAiB,EACjBC,aAAe,CAAA,CAAA,CAAA,CACfC,gBAAgB,CAChBC,CAAAA,YAAAA,CAAAA,CAAc,EACdC,OAAS,CAAA,CAAA,CAAA,CACTC,UAAU,CACVC,CAAAA,YAAAA,CAAAA,CAAc,CACd3E,CAAAA,KAAAA,CAAAA,CAAO,EACP4E,YAAc,CAAA,CAAA,CAAA,CAAA,CAAA,EAIwCX,OAAOC,MAAO,gCACjEF,OACHhE,KAAO,CAAA,CAAA,CAAA,CACP4E,cAAc,CAIuCX,GAAAA,CAAAA,MAAAA,CAAOC,sCACzDF,CAAAA,MACHhE,OAAO,CACPoE,CAAAA,WAAAA,CAAAA,CAAa"}
|
1
|
+
{"version":3,"file":"form.cjs.js","sources":["../../../src/internal/form.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { NileFormControl } from '../internal/nile-element';\nimport type { NileButton } from '../nile-button';\n\n//\n// We store a WeakMap of forms + controls so we can keep references to all Nile controls within a given form. As\n// elements connect and disconnect to/from the DOM, their containing form is used as the key and the form control is\n// added and removed from the form's set, respectively.\n//\nexport const formCollections: WeakMap<HTMLFormElement, Set<NileFormControl>> = new WeakMap();\n\n//\n// We store a WeakMap of reportValidity() overloads so we can override it when form controls connect to the DOM and\n// restore the original behavior when they disconnect.\n//\nconst reportValidityOverloads: WeakMap<HTMLFormElement, () => boolean> = new WeakMap();\n\n//\n// We store a Set of controls that users have interacted with. This allows us to determine the interaction state\n// without littering the DOM with additional data attributes.\n//\nconst userInteractedControls: WeakSet<NileFormControl> = new WeakSet();\n\n//\n// We store a WeakMap of interactions for each form control so we can track when all conditions are met for validation.\n//\nconst interactions = new WeakMap<NileFormControl, string[]>();\n\nexport interface FormControlControllerOptions {\n /** A function that returns the form containing the form control. */\n form: (input: NileFormControl) => HTMLFormElement | null;\n /** A function that returns the form control's name, which will be submitted with the form data. */\n name: (input: NileFormControl) => string;\n /** A function that returns the form control's current value. */\n value: (input: NileFormControl) => unknown | unknown[];\n /** A function that returns the form control's default value. */\n defaultValue: (input: NileFormControl) => unknown | unknown[];\n /** A function that returns the form control's current disabled state. If disabled, the value won't be submitted. */\n disabled: (input: NileFormControl) => boolean;\n /**\n * A function that maps to the form control's reportValidity() function. When the control is invalid, this will\n * prevent submission and trigger the browser's constraint violation warning.\n */\n reportValidity: (input: NileFormControl) => boolean;\n /** A function that sets the form control's value */\n setValue: (input: NileFormControl, value: unknown) => void;\n /**\n * An array of event names to listen to. When all events in the list are emitted, the control will receive validity\n * states such as user-valid and user-invalid.user interacted validity states. */\n assumeInteractionOn: string[];\n}\n\n/** A reactive controller to allow form controls to participate in form submission, validation, etc. */\nexport class FormControlController implements ReactiveController {\n host: NileFormControl & ReactiveControllerHost;\n form?: HTMLFormElement | null;\n options: FormControlControllerOptions;\n\n constructor(host: ReactiveControllerHost & NileFormControl, options?: Partial<FormControlControllerOptions>) {\n (this.host = host).addController(this);\n this.options = {\n form: input => {\n // If there's a form attribute, use it to find the target form by id\n if (input.hasAttribute('form') && input.getAttribute('form') !== '') {\n const root = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute('form');\n\n if (formId) {\n return root.getElementById(formId) as HTMLFormElement;\n }\n }\n\n return input.closest('form');\n },\n name: input => input.name,\n value: input => input.value,\n defaultValue: input => input.defaultValue,\n disabled: input => input.disabled ?? false,\n reportValidity: input => (typeof input.reportValidity === 'function' ? input.reportValidity() : true),\n setValue: (input, value: string) => (input.value = value),\n assumeInteractionOn: ['nile-input'],\n ...options\n };\n this.handleFormData = this.handleFormData.bind(this);\n this.handleFormSubmit = this.handleFormSubmit.bind(this);\n this.handleFormReset = this.handleFormReset.bind(this);\n this.reportFormValidity = this.reportFormValidity.bind(this);\n this.handleInteraction = this.handleInteraction.bind(this);\n }\n\n hostConnected() {\n const form = this.options.form(this.host);\n\n if (form) {\n this.attachForm(form);\n }\n\n // Listen for interactions\n interactions.set(this.host, []);\n this.options.assumeInteractionOn.forEach(event => {\n this.host.addEventListener(event, this.handleInteraction);\n });\n }\n\n hostDisconnected() {\n this.detachForm();\n\n // Clean up interactions\n interactions.delete(this.host);\n this.options.assumeInteractionOn.forEach(event => {\n this.host.removeEventListener(event, this.handleInteraction);\n });\n }\n\n hostUpdated() {\n const form = this.options.form(this.host);\n\n // Detach if the form no longer exists\n if (!form) {\n this.detachForm();\n }\n\n // If the form has changed, reattach it\n if (form && this.form !== form) {\n this.detachForm();\n this.attachForm(form);\n }\n\n if (this.host.hasUpdated) {\n this.setValidity(this.host.validity.valid);\n }\n }\n\n private attachForm(form?: HTMLFormElement) {\n if (form) {\n this.form = form;\n\n // Add this element to the form's collection\n if (formCollections.has(this.form)) {\n formCollections.get(this.form)!.add(this.host);\n } else {\n formCollections.set(this.form, new Set<NileFormControl>([this.host]));\n }\n\n this.form.addEventListener('formdata', this.handleFormData);\n this.form.addEventListener('submit', this.handleFormSubmit);\n this.form.addEventListener('reset', this.handleFormReset);\n\n // Overload the form's reportValidity() method so it looks at nile form controls\n if (!reportValidityOverloads.has(this.form)) {\n reportValidityOverloads.set(this.form, this.form.reportValidity);\n this.form.reportValidity = () => this.reportFormValidity();\n }\n } else {\n this.form = undefined;\n }\n }\n\n private detachForm() {\n if (this.form) {\n // Remove this element from the form's collection\n formCollections.get(this.form)?.delete(this.host);\n\n this.form.removeEventListener('formdata', this.handleFormData);\n this.form.removeEventListener('submit', this.handleFormSubmit);\n this.form.removeEventListener('reset', this.handleFormReset);\n\n // Remove the overload and restore the original method\n if (reportValidityOverloads.has(this.form)) {\n this.form.reportValidity = reportValidityOverloads.get(this.form)!;\n reportValidityOverloads.delete(this.form);\n }\n }\n\n this.form = undefined;\n }\n\n private handleFormData(event: FormDataEvent) {\n const disabled = this.options.disabled(this.host);\n const name = this.options.name(this.host);\n const value = this.options.value(this.host);\n\n // For buttons, we only submit the value if they were the submitter. This is currently done in doAction() by\n // injecting the name/value on a temporary button, so we can just skip them here.\n const isButton = this.host.tagName.toLowerCase() === 'nile-button';\n\n if (!disabled && !isButton && typeof name === 'string' && name.length > 0 && typeof value !== 'undefined') {\n if (Array.isArray(value)) {\n (value as unknown[]).forEach(val => {\n event.formData.append(name, (val as string | number | boolean).toString());\n });\n } else {\n event.formData.append(name, (value as string | number | boolean).toString());\n }\n }\n }\n\n private handleFormSubmit(event: Event) {\n const disabled = this.options.disabled(this.host);\n const reportValidity = this.options.reportValidity;\n\n // Update the interacted state for all controls when the form is submitted\n if (this.form && !this.form.noValidate) {\n formCollections.get(this.form)?.forEach(control => {\n this.setUserInteracted(control, true);\n });\n }\n\n if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n private handleFormReset() {\n this.options.setValue(this.host, this.options.defaultValue(this.host));\n this.setUserInteracted(this.host, false);\n interactions.set(this.host, []);\n }\n\n private handleInteraction(event: Event) {\n const emittedEvents = interactions.get(this.host)!;\n\n if (!emittedEvents.includes(event.type)) {\n emittedEvents.push(event.type);\n }\n\n // Mark it as user-interacted as soon as all associated events have been emitted\n if (emittedEvents.length === this.options.assumeInteractionOn.length) {\n this.setUserInteracted(this.host, true);\n }\n }\n\n private reportFormValidity() {\n //\n // Nile form controls work hard to act like regular form controls. They support the Constraint Validation API\n // and its associated methods such as setCustomValidity() and reportValidity(). However, the HTMLFormElement also\n // has a reportValidity() method that will trigger validation on all child controls. Since we're not yet using\n // ElementInternals, we need to overload this method so it looks for any element with the reportValidity() method.\n //\n // We preserve the original method in a WeakMap, but we don't call it from the overload because that would trigger\n // validations in an unexpected order. When the element disconnects, we revert to the original behavior. This won't\n // be necessary once we can use ElementInternals.\n //\n // Note that we're also honoring the form's novalidate attribute.\n //\n if (this.form && !this.form.noValidate) {\n // This seems sloppy, but checking all elements will cover native inputs, Nile inputs, and other custom\n // elements that support the constraint validation API.\n const elements = this.form.querySelectorAll<HTMLInputElement>('*');\n\n for (const element of elements) {\n if (typeof element.reportValidity === 'function') {\n if (!element.reportValidity()) {\n return false;\n }\n }\n }\n }\n\n return true;\n }\n\n private setUserInteracted(el: NileFormControl, hasInteracted: boolean) {\n if (hasInteracted) {\n userInteractedControls.add(el);\n } else {\n userInteractedControls.delete(el);\n }\n\n el.requestUpdate();\n }\n\n private doAction(type: 'submit' | 'reset', submitter?: HTMLInputElement | NileButton) {\n if (this.form) {\n const button = document.createElement('button');\n button.type = type;\n button.style.position = 'absolute';\n button.style.width = '0';\n button.style.height = '0';\n button.style.clipPath = 'inset(50%)';\n button.style.overflow = 'hidden';\n button.style.whiteSpace = 'nowrap';\n\n // Pass name, value, and form attributes through to the temporary button\n if (submitter) {\n button.name = submitter.name;\n button.value = submitter.value;\n\n ['formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach(attr => {\n if (submitter.hasAttribute(attr)) {\n button.setAttribute(attr, submitter.getAttribute(attr)!);\n }\n });\n }\n\n this.form.append(button);\n button.click();\n button.remove();\n }\n }\n\n /** Returns the associated `<form>` element, if one exists. */\n getForm() {\n return this.form ?? null;\n }\n\n /** Resets the form, restoring all the control to their default value */\n reset(submitter?: HTMLInputElement | NileButton) {\n this.doAction('reset', submitter);\n }\n\n /** Submits the form, triggering validation and form data injection. */\n submit(submitter?: HTMLInputElement | NileButton) {\n // Calling form.submit() bypasses the submit event and constraint validation. To prevent this, we can inject a\n // native submit button into the form, \"click\" it, then remove it to simulate a standard form submission.\n this.doAction('submit', submitter);\n }\n\n /**\n * Synchronously sets the form control's validity. Call this when you know the future validity but need to update\n * the host element immediately, i.e. before Lit updates the component in the next update.\n */\n setValidity(isValid: boolean) {\n const host = this.host;\n const hasInteracted = Boolean(userInteractedControls.has(host));\n const required = Boolean(host.required);\n\n //\n // We're mapping the following \"states\" to data attributes. In the future, we can use ElementInternals.states to\n // create a similar mapping, but instead of [data-invalid] it will look like :--invalid.\n //\n //\n host.toggleAttribute('data-required', required);\n host.toggleAttribute('data-optional', !required);\n host.toggleAttribute('data-invalid', !isValid);\n host.toggleAttribute('data-valid', isValid);\n host.toggleAttribute('data-user-invalid', !isValid && hasInteracted);\n host.toggleAttribute('data-user-valid', isValid && hasInteracted);\n }\n\n /**\n * Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything\n * that affects constraint validation changes so the component receives the correct validity states.\n */\n updateValidity() {\n const host = this.host;\n this.setValidity(host.validity.valid);\n }\n\n /**\n * Dispatches a non-bubbling, cancelable custom event of type `nile-invalid`.\n * If the `nile-invalid` event will be cancelled then the original `invalid`\n * event (which may have been passed as argument) will also be cancelled.\n * If no original `invalid` event has been passed then the `nile-invalid`\n * event will be cancelled before being dispatched.\n */\n emitInvalidEvent(originalInvalidEvent?: Event) {\n const slInvalidEvent = new CustomEvent<Record<PropertyKey, never>>('nile-invalid', {\n bubbles: false,\n composed: false,\n cancelable: true,\n detail: {}\n });\n\n if (!originalInvalidEvent) {\n slInvalidEvent.preventDefault();\n }\n\n if (!this.host.dispatchEvent(slInvalidEvent)) {\n originalInvalidEvent?.preventDefault();\n }\n }\n}\n\n/*\n * Predefined common validity states.\n * All of them are read-only.\n */\n\n// A validity state object that represents `valid`\nexport const validValidityState: ValidityState = Object.freeze({\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: true,\n valueMissing: false\n});\n\n// A validity state object that represents `value missing`\nexport const valueMissingValidityState: ValidityState = Object.freeze({\n ...validValidityState,\n valid: false,\n valueMissing: true\n});\n\n// A validity state object that represents a custom error\nexport const customErrorValidityState: ValidityState = Object.freeze({\n ...validValidityState,\n valid: false,\n customError: true\n});\n"],"names":["formCollections","WeakMap","reportValidityOverloads","userInteractedControls","WeakSet","interactions","FormControlController","e","host","options","this","addController","_objectSpread","form","input","hasAttribute","getAttribute","root","getRootNode","formId","getElementById","closest","name","value","defaultValue","disabled","reportValidity","setValue","assumeInteractionOn","handleFormData","bind","handleFormSubmit","handleFormReset","reportFormValidity","handleInteraction","_createClass","key","hostConnected","_this","attachForm","set","forEach","event","addEventListener","hostDisconnected","detachForm","removeEventListener","hostUpdated","hasUpdated","setValidity","validity","valid","has","get","add","Set","undefined","isButton","tagName","toLowerCase","length","Array","isArray","val","formData","append","toString","noValidate","control","setUserInteracted","preventDefault","stopImmediatePropagation","emittedEvents","includes","type","push","elements","querySelectorAll","_iterator","_createForOfIteratorHelper","s","_step","n","done","element","err","f","el","hasInteracted","delete","requestUpdate","doAction","submitter","button","document","createElement","style","position","width","height","clipPath","overflow","whiteSpace","attr","setAttribute","click","remove","getForm","_this$form","reset","submit","isValid","Boolean","required","toggleAttribute","updateValidity","emitInvalidEvent","originalInvalidEvent","slInvalidEvent","CustomEvent","bubbles","composed","cancelable","detail","dispatchEvent","_export","validValidityState","Object","freeze","badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"],"mappings":"+pHASaA,EAAkE,GAAIC,CAAAA,OAAAA,CAAAA,CAAAA,CAM7EC,EAAmE,GAAID,CAAAA,OAAAA,CAAAA,CAAAA,CAMvEE,EAAmD,GAAIC,C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,CACE,GAAM3G,CAAAA,CAAOE,CAAAA,IAAAA,CAAKF,KAClBE,IAAKuC,CAAAA,WAAAA,CAAYzC,EAAK0C,QAASC,CAAAA,KAAAA,CAChC,EASD,GAAAf,GAAA,oBAAAb,KAAA,UAAA6F,iBAAiBC,GACf,GAAMC,CAAAA,CAAAA,CAAiB,GAAIC,CAAAA,WAAwC,CAAA,cAAA,CAAgB,CACjFC,OAAS,CAAA,CAAA,CAAA,CACTC,UAAU,CACVC,CAAAA,UAAAA,CAAAA,CAAY,EACZC,MAAQ,CAAA,CAAE,IAGPN,CACHC,EAAAA,CAAAA,CAAehD,iBAGZ5D,IAAKF,CAAAA,IAAAA,CAAKoH,cAAcN,CAC3BD,CAAAA,GAAAA,CAAAA,SAAAA,CAAAA,iBAAAA,CAAAA,CAAsB/C,cAEzB,CAAA,CAAA,GAAA,WAAA/D,CAAA,MAAAsH,OAAA,KASUC,CAAoCC,CAAAA,MAAAA,CAAOC,OAAO,CAC7DC,QAAAA,CAAAA,CAAU,EACVC,WAAa,CAAA,CAAA,CAAA,CACbC,iBAAiB,CACjBC,CAAAA,aAAAA,CAAAA,CAAe,EACfC,cAAgB,CAAA,CAAA,CAAA,CAChBC,cAAc,CACdC,CAAAA,OAAAA,CAAAA,CAAS,EACTC,QAAU,CAAA,CAAA,CAAA,CACVC,cAAc,CACdtF,CAAAA,KAAAA,CAAAA,CAAO,EACPuF,YAAc,CAAA,CAAA,CAAA,CAAA,CAAA,EAIwCX,OAAOC,MAAO,CAAApH,aAAA,CAAAA,aAAA,IACjEkH,OACH3E,KAAO,CAAA,CAAA,CAAA,CACPuF,cAAc,CAIuCX,EAAAA,CAAAA,CAAAA,MAAAA,CAAOC,sCACzDF,CAAAA,MACH3E,OAAO,CACP+E,CAAAA,WAAAA,CAAAA,CAAa"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-element.cjs.js","sources":["../../../src/internal/nile-element.ts"],"sourcesContent":["import { LitElement } from 'lit';\n\nexport default class NileElement extends LitElement {\n\n /** Emits a custom event with more convenient defaults. */\n emit(name: string, detail?: any) {\n const event = new CustomEvent(name, {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail\n });\n\n this.dispatchEvent(event);\n }\n}\n\n\nexport interface NileFormControl extends NileElement {\n // Form attributes\n name: string;\n value: unknown;\n disabled?: boolean;\n defaultValue?: unknown;\n defaultChecked?: boolean;\n form?: string;\n\n // Constraint validation attributes\n pattern?: string;\n min?: number | string | Date;\n max?: number | string | Date;\n step?: number | 'any';\n required?: boolean;\n minlength?: number;\n maxlength?: number;\n\n // Form validation properties\n readonly validity: ValidityState;\n readonly validationMessage: string;\n\n // Form validation methods\n checkValidity: () => boolean;\n getForm: () => HTMLFormElement | null;\n reportValidity: () => boolean;\n setCustomValidity: (message: string) => void;\n}\n\n"],"names":["NileElement","
|
1
|
+
{"version":3,"file":"nile-element.cjs.js","sources":["../../../src/internal/nile-element.ts"],"sourcesContent":["import { LitElement } from 'lit';\n\nexport default class NileElement extends LitElement {\n\n /** Emits a custom event with more convenient defaults. */\n emit(name: string, detail?: any) {\n const event = new CustomEvent(name, {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail\n });\n\n this.dispatchEvent(event);\n }\n}\n\n\nexport interface NileFormControl extends NileElement {\n // Form attributes\n name: string;\n value: unknown;\n disabled?: boolean;\n defaultValue?: unknown;\n defaultChecked?: boolean;\n form?: string;\n\n // Constraint validation attributes\n pattern?: string;\n min?: number | string | Date;\n max?: number | string | Date;\n step?: number | 'any';\n required?: boolean;\n minlength?: number;\n maxlength?: number;\n\n // Form validation properties\n readonly validity: ValidityState;\n readonly validationMessage: string;\n\n // Form validation methods\n checkValidity: () => boolean;\n getForm: () => HTMLFormElement | null;\n reportValidity: () => boolean;\n setCustomValidity: (message: string) => void;\n}\n\n"],"names":["NileElement","emit","name","detail","event","CustomEvent","bubbles","cancelable","composed","this","dispatchEvent","LitElement"],"mappings":"0oGAEqBA,CAAAA,uBAAAA,EAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,MAAAA,MAAAA,CAAAA,YAAAA,CAAAA,CAAAA,WAAAA,EAAAA,EAAAA,eAAAA,MAAAA,CAAAA,SAAAA,MAAAA,CAAAA,KAAAA,MAAAA,SAAAA,GAAAA,YAAAA,CAAAA,CAAAA,GAAAA,GAAAA,QAAAA,KAAAA,CAGnB,SAAAC,KAAKC,CAAcC,CAAAA,EAAAA,CAAAA,CACjB,GAAMC,CAAAA,CAAAA,CAAQ,GAAIC,CAAAA,WAAAA,CAAYH,EAAM,CAClCI,OAAAA,CAAAA,CAAS,CACTC,CAAAA,UAAAA,CAAAA,CAAY,CACZC,CAAAA,QAAAA,CAAAA,CAAU,EACVL,MAGFM,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,IAAAA,CAAKC,aAAcN,CAAAA,CAAAA,CACpB,iBAZsCO,CAGvC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"offset.cjs.js","sources":["../../../src/internal/offset.ts"],"sourcesContent":["/**\n * Returns an element's offset relative to its parent. Similar to element.offsetTop and element.offsetLeft, except the\n * parent doesn't have to be positioned relative or absolute.\n *\n * NOTE: This was created to work around what appears to be a bug in Chrome where a slotted element's offsetParent seems\n * to ignore elements inside the surrounding shadow DOM: https://bugs.chromium.org/p/chromium/issues/detail?id=920069\n */\nexport function getOffset(element: HTMLElement, parent: HTMLElement) {\n return {\n top: Math.round(element.getBoundingClientRect().top - parent.getBoundingClientRect().top),\n left: Math.round(element.getBoundingClientRect().left - parent.getBoundingClientRect().left)\n };\n}\n"],"names":["getOffset","element","parent","top","Math","round","getBoundingClientRect","left"],"mappings":"2DAOgB,QAAAA,
|
1
|
+
{"version":3,"file":"offset.cjs.js","sources":["../../../src/internal/offset.ts"],"sourcesContent":["/**\n * Returns an element's offset relative to its parent. Similar to element.offsetTop and element.offsetLeft, except the\n * parent doesn't have to be positioned relative or absolute.\n *\n * NOTE: This was created to work around what appears to be a bug in Chrome where a slotted element's offsetParent seems\n * to ignore elements inside the surrounding shadow DOM: https://bugs.chromium.org/p/chromium/issues/detail?id=920069\n */\nexport function getOffset(element: HTMLElement, parent: HTMLElement) {\n return {\n top: Math.round(element.getBoundingClientRect().top - parent.getBoundingClientRect().top),\n left: Math.round(element.getBoundingClientRect().left - parent.getBoundingClientRect().left)\n };\n}\n"],"names":["getOffset","element","parent","top","Math","round","getBoundingClientRect","left"],"mappings":"2DAOgB,QAAAA,CAAAA,CAAAA,CAAUC,EAAsBC,CAC9C,CAAA,CAAA,MAAO,CACLC,GAAKC,CAAAA,IAAAA,CAAKC,KAAMJ,CAAAA,CAAAA,CAAQK,qBAAwBH,CAAAA,CAAAA,CAAAA,GAAAA,CAAMD,EAAOI,qBAAwBH,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,CACrFI,IAAMH,CAAAA,IAAAA,CAAKC,KAAMJ,CAAAA,CAAAA,CAAQK,wBAAwBC,IAAOL,CAAAA,CAAAA,CAAOI,qBAAwBC,CAAAA,CAAAA,CAAAA,IAAAA,CAAAA,CAE3F"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scroll.cjs.js","sources":["../../../src/internal/scroll.ts"],"sourcesContent":["import { getOffset } from './offset';\n\nconst locks = new Set();\n\n/** Returns the width of the document's scrollbar */\nfunction getScrollbarWidth() {\n const documentWidth = document.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n}\n\n/**\n * Prevents body scrolling. Keeps track of which elements requested a lock so multiple levels of locking are possible\n * without premature unlocking.\n */\nexport function lockBodyScrolling(lockingEl: HTMLElement) {\n locks.add(lockingEl);\n\n // When the first lock is created, set the scroll lock size to match the scrollbar's width to prevent content from\n // shifting. We only do this on the first lock because the scrollbar width will measure zero after overflow is hidden.\n if (!document.body.classList.contains('nile-scroll-lock')) {\n const scrollbarWidth = getScrollbarWidth(); // must be measured before the `nile-scroll-lock` class is applied\n document.body.classList.add('nile-scroll-lock');\n document.body.style.setProperty('--nile-scroll-lock-size', `${scrollbarWidth}px`);\n }\n}\n\n/**\n * Unlocks body scrolling. Scrolling will only be unlocked once all elements that requested a lock call this method.\n */\nexport function unlockBodyScrolling(lockingEl: HTMLElement) {\n locks.delete(lockingEl);\n\n if (locks.size === 0) {\n document.body.classList.remove('nile-scroll-lock');\n document.body.style.removeProperty('--nile-scroll-lock-size');\n }\n}\n\n/** Scrolls an element into view of its container. If the element is already in view, nothing will happen. */\nexport function scrollIntoView(\n element: HTMLElement,\n container: HTMLElement,\n direction: 'horizontal' | 'vertical' | 'both' = 'vertical',\n behavior: 'smooth' | 'auto' = 'smooth'\n) {\n const offset = getOffset(element, container);\n const offsetTop = offset.top + container.scrollTop;\n const offsetLeft = offset.left + container.scrollLeft;\n const minX = container.scrollLeft;\n const maxX = container.scrollLeft + container.offsetWidth;\n const minY = container.scrollTop;\n const maxY = container.scrollTop + container.offsetHeight;\n\n if (direction === 'horizontal' || direction === 'both') {\n if (offsetLeft < minX) {\n container.scrollTo({ left: offsetLeft, behavior });\n } else if (offsetLeft + element.clientWidth > maxX) {\n container.scrollTo({ left: offsetLeft - container.offsetWidth + element.clientWidth, behavior });\n }\n }\n\n if (direction === 'vertical' || direction === 'both') {\n if (offsetTop < minY) {\n container.scrollTo({ top: offsetTop, behavior });\n } else if (offsetTop + element.clientHeight > maxY) {\n container.scrollTo({ top: offsetTop - container.offsetHeight + element.clientHeight, behavior });\n }\n }\n}\n"],"names":["scrollIntoView","element","container","direction","behavior","offset","getOffset","offsetTop","top","scrollTop","offsetLeft","left","scrollLeft","minX","maxX","offsetWidth","minY","maxY","offsetHeight","scrollTo","clientWidth","a","clientHeight"],"mappings":"kFAuCM,QAAUA,
|
1
|
+
{"version":3,"file":"scroll.cjs.js","sources":["../../../src/internal/scroll.ts"],"sourcesContent":["import { getOffset } from './offset';\n\nconst locks = new Set();\n\n/** Returns the width of the document's scrollbar */\nfunction getScrollbarWidth() {\n const documentWidth = document.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n}\n\n/**\n * Prevents body scrolling. Keeps track of which elements requested a lock so multiple levels of locking are possible\n * without premature unlocking.\n */\nexport function lockBodyScrolling(lockingEl: HTMLElement) {\n locks.add(lockingEl);\n\n // When the first lock is created, set the scroll lock size to match the scrollbar's width to prevent content from\n // shifting. We only do this on the first lock because the scrollbar width will measure zero after overflow is hidden.\n if (!document.body.classList.contains('nile-scroll-lock')) {\n const scrollbarWidth = getScrollbarWidth(); // must be measured before the `nile-scroll-lock` class is applied\n document.body.classList.add('nile-scroll-lock');\n document.body.style.setProperty('--nile-scroll-lock-size', `${scrollbarWidth}px`);\n }\n}\n\n/**\n * Unlocks body scrolling. Scrolling will only be unlocked once all elements that requested a lock call this method.\n */\nexport function unlockBodyScrolling(lockingEl: HTMLElement) {\n locks.delete(lockingEl);\n\n if (locks.size === 0) {\n document.body.classList.remove('nile-scroll-lock');\n document.body.style.removeProperty('--nile-scroll-lock-size');\n }\n}\n\n/** Scrolls an element into view of its container. If the element is already in view, nothing will happen. */\nexport function scrollIntoView(\n element: HTMLElement,\n container: HTMLElement,\n direction: 'horizontal' | 'vertical' | 'both' = 'vertical',\n behavior: 'smooth' | 'auto' = 'smooth'\n) {\n const offset = getOffset(element, container);\n const offsetTop = offset.top + container.scrollTop;\n const offsetLeft = offset.left + container.scrollLeft;\n const minX = container.scrollLeft;\n const maxX = container.scrollLeft + container.offsetWidth;\n const minY = container.scrollTop;\n const maxY = container.scrollTop + container.offsetHeight;\n\n if (direction === 'horizontal' || direction === 'both') {\n if (offsetLeft < minX) {\n container.scrollTo({ left: offsetLeft, behavior });\n } else if (offsetLeft + element.clientWidth > maxX) {\n container.scrollTo({ left: offsetLeft - container.offsetWidth + element.clientWidth, behavior });\n }\n }\n\n if (direction === 'vertical' || direction === 'both') {\n if (offsetTop < minY) {\n container.scrollTo({ top: offsetTop, behavior });\n } else if (offsetTop + element.clientHeight > maxY) {\n container.scrollTo({ top: offsetTop - container.offsetHeight + element.clientHeight, behavior });\n }\n }\n}\n"],"names":["scrollIntoView","element","container","direction","arguments","length","undefined","behavior","offset","getOffset","offsetTop","top","scrollTop","offsetLeft","left","scrollLeft","minX","maxX","offsetWidth","minY","maxY","offsetHeight","scrollTo","clientWidth","a","clientHeight"],"mappings":"kFAuCM,QAAUA,CAAAA,CACdC,CAAAA,CAAAA,CACAC,EAIA,IAHAC,CAAAA,CAAgD,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAA,UAAA,IAChDG,CAAAA,4DAA8B,QAE9B,CAAA,GAAMC,CAAAA,EAASC,CAAUR,CAAAA,CAAAA,CAASC,GAC5BQ,CAAYF,CAAAA,CAAAA,CAAOG,IAAMT,CAAUU,CAAAA,SAAAA,CACnCC,EAAaL,CAAOM,CAAAA,IAAAA,CAAOZ,EAAUa,UACrCC,CAAAA,CAAAA,CAAOd,EAAUa,UACjBE,CAAAA,CAAAA,CAAOf,EAAUa,UAAab,CAAAA,CAAAA,CAAUgB,YACxCC,CAAOjB,CAAAA,CAAAA,CAAUU,UACjBQ,CAAOlB,CAAAA,CAAAA,CAAUU,UAAYV,CAAUmB,CAAAA,YAAAA,CAE3B,eAAdlB,CAA4C,EAAA,MAAA,GAAdA,IAC5BU,CAAaG,CAAAA,CAAAA,CACfd,EAAUoB,QAAS,CAAA,CAAER,KAAMD,CAAYN,CAAAA,QAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAC9BM,EAAaZ,CAAQsB,CAAAA,WAAAA,CAAcN,GAC5Cf,CAAUoB,CAAAA,QAAAA,CAAS,CAAER,IAAMD,CAAAA,CAAAA,CAAaX,EAAUgB,WAAcjB,CAAAA,CAAAA,CAAQsB,YAAahB,QAIvE,CAAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,GAAdrB,GAA0C,MAAdA,GAAAA,CAAAA,GAC1BO,EAAYS,CACdjB,CAAAA,CAAAA,CAAUoB,SAAS,CAAEX,GAAAA,CAAKD,EAAWH,QAC5BG,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAYT,EAAQwB,YAAeL,CAAAA,CAAAA,EAC5ClB,EAAUoB,QAAS,CAAA,CAAEX,IAAKD,CAAYR,CAAAA,CAAAA,CAAUmB,aAAepB,CAAQwB,CAAAA,YAAAA,CAAclB,aAG3F"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";var t;function _typeof(
|
1
|
+
System.register([],function(_export,_context){"use strict";var t;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);}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_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(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function s(t){if(!t)return"";var s=t.assignedNodes({flatten:!0});var e="";return _toConsumableArray(s).forEach(function(t){t.nodeType===Node.TEXT_NODE&&(e+=t.textContent);}),e;}_export("g",s);return{setters:[],execute:function(){_export("H",t=/*#__PURE__*/function(){function t(_t){_classCallCheck(this,t);for(var _len=arguments.length,s=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){s[_key-1]=arguments[_key];}this.slotNames=[],(this.host=_t).addController(this),this.slotNames=s,this.handleSlotChange=this.handleSlotChange.bind(this);}_createClass(t,[{key:"hasDefaultSlot",value:function hasDefaultSlot(){return _toConsumableArray(this.host.childNodes).some(function(_t2){if(_t2.nodeType===_t2.TEXT_NODE&&""!==_t2.textContent.trim())return!0;if(_t2.nodeType===_t2.ELEMENT_NODE){var _s=_t2;if("nile-visually-hidden"===_s.tagName.toLowerCase())return!1;if(!_s.hasAttribute("slot"))return!0;}return!1;});}},{key:"hasNamedSlot",value:function hasNamedSlot(_t3){return null!==this.host.querySelector(":scope > [slot=\"".concat(_t3,"\"]"));}},{key:"test",value:function test(_t4){return"[default]"===_t4?this.hasDefaultSlot():this.hasNamedSlot(_t4);}},{key:"hostConnected",value:function hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange);}},{key:"hostDisconnected",value:function hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange);}},{key:"handleSlotChange",value:function handleSlotChange(_t5){var s=_t5.target;(this.slotNames.includes("[default]")&&!s.name||s.name&&this.slotNames.includes(s.name))&&this.host.requestUpdate();}}]);return t;}());}};});
|
2
2
|
//# sourceMappingURL=slot.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slot.cjs.js","sources":["../../../src/internal/slot.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/** A reactive controller that determines when slots exist. */\nexport class HasSlotController implements ReactiveController {\n host: ReactiveControllerHost & Element;\n slotNames: string[] = [];\n\n constructor(host: ReactiveControllerHost & Element, ...slotNames: string[]) {\n (this.host = host).addController(this);\n this.slotNames = slotNames;\n this.handleSlotChange = this.handleSlotChange.bind(this);\n }\n\n private hasDefaultSlot() {\n return [...this.host.childNodes].some(node => {\n if (node.nodeType === node.TEXT_NODE && node.textContent!.trim() !== '') {\n return true;\n }\n\n if (node.nodeType === node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n const tagName = el.tagName.toLowerCase();\n\n // Ignore visually hidden elements since they aren't rendered\n if (tagName === 'nile-visually-hidden') {\n return false;\n }\n\n // If it doesn't have a slot attribute, it's part of the default slot\n if (!el.hasAttribute('slot')) {\n return true;\n }\n }\n\n return false;\n });\n }\n\n private hasNamedSlot(name: string) {\n return this.host.querySelector(`:scope > [slot=\"${name}\"]`) !== null;\n }\n\n test(slotName: string) {\n return slotName === '[default]' ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);\n }\n\n hostConnected() {\n this.host.shadowRoot!.addEventListener('slotchange', this.handleSlotChange);\n }\n\n hostDisconnected() {\n this.host.shadowRoot!.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n handleSlotChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n\n if ((this.slotNames.includes('[default]') && !slot.name) || (slot.name && this.slotNames.includes(slot.name))) {\n this.host.requestUpdate();\n }\n }\n}\n\n/**\n * Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated\n * HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.\n */\nexport function getInnerHTML(slot: HTMLSlotElement): string {\n const nodes = slot.assignedNodes({ flatten: true });\n let html = '';\n\n [...nodes].forEach(node => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n html += (node as HTMLElement).outerHTML;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n html += node.textContent;\n }\n });\n\n return html;\n}\n\n/**\n * Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a\n * string. This is useful because we can't use slot.textContent as an alternative.\n */\nexport function getTextContent(slot: HTMLSlotElement | undefined | null): string {\n if (!slot) {\n return '';\n }\n const nodes = slot.assignedNodes({ flatten: true });\n let text = '';\n\n [...nodes].forEach(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent;\n }\n });\n\n return text;\n}\n"],"names":["getTextContent","slot","nodes","assignedNodes","flatten","text","forEach","node","nodeType","Node","TEXT_NODE","textContent","HasSlotController","
|
1
|
+
{"version":3,"file":"slot.cjs.js","sources":["../../../src/internal/slot.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/** A reactive controller that determines when slots exist. */\nexport class HasSlotController implements ReactiveController {\n host: ReactiveControllerHost & Element;\n slotNames: string[] = [];\n\n constructor(host: ReactiveControllerHost & Element, ...slotNames: string[]) {\n (this.host = host).addController(this);\n this.slotNames = slotNames;\n this.handleSlotChange = this.handleSlotChange.bind(this);\n }\n\n private hasDefaultSlot() {\n return [...this.host.childNodes].some(node => {\n if (node.nodeType === node.TEXT_NODE && node.textContent!.trim() !== '') {\n return true;\n }\n\n if (node.nodeType === node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n const tagName = el.tagName.toLowerCase();\n\n // Ignore visually hidden elements since they aren't rendered\n if (tagName === 'nile-visually-hidden') {\n return false;\n }\n\n // If it doesn't have a slot attribute, it's part of the default slot\n if (!el.hasAttribute('slot')) {\n return true;\n }\n }\n\n return false;\n });\n }\n\n private hasNamedSlot(name: string) {\n return this.host.querySelector(`:scope > [slot=\"${name}\"]`) !== null;\n }\n\n test(slotName: string) {\n return slotName === '[default]' ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);\n }\n\n hostConnected() {\n this.host.shadowRoot!.addEventListener('slotchange', this.handleSlotChange);\n }\n\n hostDisconnected() {\n this.host.shadowRoot!.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n handleSlotChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n\n if ((this.slotNames.includes('[default]') && !slot.name) || (slot.name && this.slotNames.includes(slot.name))) {\n this.host.requestUpdate();\n }\n }\n}\n\n/**\n * Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated\n * HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.\n */\nexport function getInnerHTML(slot: HTMLSlotElement): string {\n const nodes = slot.assignedNodes({ flatten: true });\n let html = '';\n\n [...nodes].forEach(node => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n html += (node as HTMLElement).outerHTML;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n html += node.textContent;\n }\n });\n\n return html;\n}\n\n/**\n * Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a\n * string. This is useful because we can't use slot.textContent as an alternative.\n */\nexport function getTextContent(slot: HTMLSlotElement | undefined | null): string {\n if (!slot) {\n return '';\n }\n const nodes = slot.assignedNodes({ flatten: true });\n let text = '';\n\n [...nodes].forEach(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent;\n }\n });\n\n return text;\n}\n"],"names":["getTextContent","slot","nodes","assignedNodes","flatten","text","_toConsumableArray","forEach","node","nodeType","Node","TEXT_NODE","textContent","HasSlotController","t","host","slotNames","this","addController","handleSlotChange","bind","_createClass","key","value","hasDefaultSlot","childNodes","some","trim","ELEMENT_NODE","el","tagName","toLowerCase","hasAttribute","hasNamedSlot","name","querySelector","test","slotName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AKiC,IAAUjC,EAAAA,CAAAA,CAAKiC,IAAQjB,EAAAA,IAAAA,CAAKD,UAAU6B,QAAS5C,CAAAA,CAAAA,CAAKiC,QACrGjB,IAAKF,CAAAA,IAAAA,CAAK+B,eAEb,EA4BG,WAAAhC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tabbable.cjs.js","sources":["../../../src/internal/tabbable.ts"],"sourcesContent":["/** Determines if the specified element is tabbable using heuristics inspired by https://github.com/focus-trap/tabbable */\nfunction isTabbable(el: HTMLElement) {\n const tag = el.tagName.toLowerCase();\n\n // Elements with a -1 tab index are not tabbable\n if (el.getAttribute('tabindex') === '-1') {\n return false;\n }\n\n // Elements with a disabled attribute are not tabbable\n if (el.hasAttribute('disabled')) {\n return false;\n }\n\n // Elements with aria-disabled are not tabbable\n if (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') !== 'false') {\n return false;\n }\n\n // Radios without a checked attribute are not tabbable\n if (tag === 'input' && el.getAttribute('type') === 'radio' && !el.hasAttribute('checked')) {\n return false;\n }\n\n // Elements that are hidden have no offsetParent and are not tabbable\n if (el.offsetParent === null) {\n return false;\n }\n\n // Elements without visibility are not tabbable\n if (window.getComputedStyle(el).visibility === 'hidden') {\n return false;\n }\n\n // Audio and video elements with the controls attribute are tabbable\n if ((tag === 'audio' || tag === 'video') && el.hasAttribute('controls')) {\n return true;\n }\n\n // Elements with a tabindex other than -1 are tabbable\n if (el.hasAttribute('tabindex')) {\n return true;\n }\n\n // Elements with a contenteditable attribute are tabbable\n if (el.hasAttribute('contenteditable') && el.getAttribute('contenteditable') !== 'false') {\n return true;\n }\n\n // At this point, the following elements are considered tabbable\n return ['button', 'input', 'select', 'textarea', 'a', 'audio', 'video', 'summary'].includes(tag);\n}\n\n/**\n * Returns the first and last bounding elements that are tabbable. This is more performant than checking every single\n * element because it short-circuits after finding the first and last ones.\n */\nexport function getTabbableBoundary(root: HTMLElement | ShadowRoot) {\n const allElements: HTMLElement[] = [];\n\n function walk(el: HTMLElement | ShadowRoot) {\n if (el instanceof HTMLElement) {\n allElements.push(el);\n\n if (el.shadowRoot !== null && el.shadowRoot.mode === 'open') {\n walk(el.shadowRoot);\n }\n }\n\n [...el.children].forEach((e: HTMLElement) => walk(e));\n }\n\n // Collect all elements including the root\n walk(root);\n\n // Find the first and last tabbable elements\n const start = allElements.find(el => isTabbable(el)) ?? null;\n const end = allElements.reverse().find(el => isTabbable(el)) ?? null;\n\n return { start, end };\n}\n"],"names":["isTabbable","el","tag","tagName","toLowerCase","getAttribute","hasAttribute","offsetParent","window","getComputedStyle","visibility","includes","getTabbableBoundary","root","allElements","walk","HTMLElement","push","shadowRoot","mode","children","forEach","e","start","find","end","reverse"],"mappings":"unCACA,QAASA,
|
1
|
+
{"version":3,"file":"tabbable.cjs.js","sources":["../../../src/internal/tabbable.ts"],"sourcesContent":["/** Determines if the specified element is tabbable using heuristics inspired by https://github.com/focus-trap/tabbable */\nfunction isTabbable(el: HTMLElement) {\n const tag = el.tagName.toLowerCase();\n\n // Elements with a -1 tab index are not tabbable\n if (el.getAttribute('tabindex') === '-1') {\n return false;\n }\n\n // Elements with a disabled attribute are not tabbable\n if (el.hasAttribute('disabled')) {\n return false;\n }\n\n // Elements with aria-disabled are not tabbable\n if (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') !== 'false') {\n return false;\n }\n\n // Radios without a checked attribute are not tabbable\n if (tag === 'input' && el.getAttribute('type') === 'radio' && !el.hasAttribute('checked')) {\n return false;\n }\n\n // Elements that are hidden have no offsetParent and are not tabbable\n if (el.offsetParent === null) {\n return false;\n }\n\n // Elements without visibility are not tabbable\n if (window.getComputedStyle(el).visibility === 'hidden') {\n return false;\n }\n\n // Audio and video elements with the controls attribute are tabbable\n if ((tag === 'audio' || tag === 'video') && el.hasAttribute('controls')) {\n return true;\n }\n\n // Elements with a tabindex other than -1 are tabbable\n if (el.hasAttribute('tabindex')) {\n return true;\n }\n\n // Elements with a contenteditable attribute are tabbable\n if (el.hasAttribute('contenteditable') && el.getAttribute('contenteditable') !== 'false') {\n return true;\n }\n\n // At this point, the following elements are considered tabbable\n return ['button', 'input', 'select', 'textarea', 'a', 'audio', 'video', 'summary'].includes(tag);\n}\n\n/**\n * Returns the first and last bounding elements that are tabbable. This is more performant than checking every single\n * element because it short-circuits after finding the first and last ones.\n */\nexport function getTabbableBoundary(root: HTMLElement | ShadowRoot) {\n const allElements: HTMLElement[] = [];\n\n function walk(el: HTMLElement | ShadowRoot) {\n if (el instanceof HTMLElement) {\n allElements.push(el);\n\n if (el.shadowRoot !== null && el.shadowRoot.mode === 'open') {\n walk(el.shadowRoot);\n }\n }\n\n [...el.children].forEach((e: HTMLElement) => walk(e));\n }\n\n // Collect all elements including the root\n walk(root);\n\n // Find the first and last tabbable elements\n const start = allElements.find(el => isTabbable(el)) ?? null;\n const end = allElements.reverse().find(el => isTabbable(el)) ?? null;\n\n return { start, end };\n}\n"],"names":["isTabbable","el","tag","tagName","toLowerCase","getAttribute","hasAttribute","offsetParent","window","getComputedStyle","visibility","includes","getTabbableBoundary","root","_t$find","_t$reverse$find","allElements","walk","HTMLElement","push","shadowRoot","mode","_toConsumableArray","children","forEach","e","start","find","end","reverse"],"mappings":"unCACA,QAASA,CAAAA,CAAAA,CAAWC,CAClB,CAAA,CAAA,GAAMC,CAAAA,CAAMD,CAAAA,CAAAA,CAAGE,OAAQC,CAAAA,WAAAA,CAAAA,CAAAA,CAGvB,MAAoC,IAAA,GAAhCH,CAAGI,CAAAA,YAAAA,CAAa,UAKhBJ,CAAAA,EAAAA,CAAAA,CAAAA,CAAGK,aAAa,UAKhBL,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAGK,YAAa,CAAA,eAAA,CAAA,EAAyD,OAArCL,GAAAA,CAAAA,CAAGI,YAAa,CAAA,eAAA,CAAA,GAAA,EAK5C,OAARH,GAAAA,CAAAA,EAA+C,OAA5BD,GAAAA,CAAAA,CAAGI,YAAa,CAAA,MAAA,CAAA,E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CAAEa,KAAAA,EAAAA,OAAAA,CAHKV,CAAYW,CAAAA,IAAAA,CAAK1B,SAAAA,CAAMD,QAAAA,CAAAA,CAAAA,CAAWC,CAAQ,CAAA,EAAA,CAAA,UAAAa,OAAA,UAAAA,OAAA,CAAA,IAAA,CAGxCc,GAFJZ,EAAAA,eAAAA,CAAAA,CAAAA,CAAYa,OAAUF,CAAAA,CAAAA,CAAAA,IAAAA,CAAK1B,SAAAA,CAAMD,QAAAA,CAAAA,CAAAA,CAAWC,CAAQ,CAAA,EAAA,CAAA,UAAAc,eAAA,UAAAA,eAAA,CAAA,IAAA,CAGlE"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";function _typeof(
|
1
|
+
System.register([],function(_export,_context){"use strict";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);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function t(t,i){var n=_objectSpread({waitUntilFirstUpdate:!1},i);return function(i,s){var o=i.update,c=Array.isArray(t)?t:[t];i.update=function(t){var _this=this;c.forEach(function(i){var o=i;if(t.has(o)){var _i=t.get(o),_c=_this[o];_i!==_c&&(n.waitUntilFirstUpdate&&!_this.hasUpdated||_this[s](_i,_c));}}),o.call(this,t);};};}_export("w",t);return{setters:[],execute:function(){}};});
|
2
2
|
//# sourceMappingURL=watch.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"watch.cjs.js","sources":["../../../src/internal/watch.ts"],"sourcesContent":["import type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\ntype UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface WatchOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n waitUntilFirstUpdate?: boolean;\n}\n\n/**\n * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an\n * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the\n * initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n *\n * Usage:\n *\n * @watch('propName')\n * handlePropChange(oldValue, newValue) {\n * ...\n * }\n */\nexport function watch(propertyName: string | string[], options?: WatchOptions) {\n const resolvedOptions: Required<WatchOptions> = {\n waitUntilFirstUpdate: false,\n ...options\n };\n return <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => {\n // @ts-expect-error - update is a protected property\n const { update } = proto;\n const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];\n\n // @ts-expect-error - update is a protected property\n proto.update = function (this: ElemClass, changedProps: Map<keyof ElemClass, ElemClass[keyof ElemClass]>) {\n watchedProperties.forEach(property => {\n const key = property as keyof ElemClass;\n if (changedProps.has(key)) {\n const oldValue = changedProps.get(key);\n const newValue = this[key];\n\n if (oldValue !== newValue) {\n if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {\n (this[decoratedFnName] as unknown as UpdateHandler)(oldValue, newValue);\n }\n }\n }\n });\n\n update.call(this, changedProps);\n };\n };\n}\n"],"names":["watch","propertyName","options","resolvedOptions","waitUntilFirstUpdate","proto","decoratedFnName","update","watchedProperties","Array","isArray","changedProps","forEach","property","key","has","oldValue","get","newValue","this","hasUpdated","call"],"mappings":"
|
1
|
+
{"version":3,"file":"watch.cjs.js","sources":["../../../src/internal/watch.ts"],"sourcesContent":["import type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\ntype UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface WatchOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n waitUntilFirstUpdate?: boolean;\n}\n\n/**\n * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an\n * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the\n * initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n *\n * Usage:\n *\n * @watch('propName')\n * handlePropChange(oldValue, newValue) {\n * ...\n * }\n */\nexport function watch(propertyName: string | string[], options?: WatchOptions) {\n const resolvedOptions: Required<WatchOptions> = {\n waitUntilFirstUpdate: false,\n ...options\n };\n return <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => {\n // @ts-expect-error - update is a protected property\n const { update } = proto;\n const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];\n\n // @ts-expect-error - update is a protected property\n proto.update = function (this: ElemClass, changedProps: Map<keyof ElemClass, ElemClass[keyof ElemClass]>) {\n watchedProperties.forEach(property => {\n const key = property as keyof ElemClass;\n if (changedProps.has(key)) {\n const oldValue = changedProps.get(key);\n const newValue = this[key];\n\n if (oldValue !== newValue) {\n if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {\n (this[decoratedFnName] as unknown as UpdateHandler)(oldValue, newValue);\n }\n }\n }\n });\n\n update.call(this, changedProps);\n };\n };\n}\n"],"names":["watch","propertyName","options","resolvedOptions","_objectSpread","waitUntilFirstUpdate","proto","decoratedFnName","update","watchedProperties","Array","isArray","changedProps","forEach","property","key","has","oldValue","get","newValue","this","hasUpdated","call"],"mappings":"4kDA6BgB,QAAAA,CAAAA,CAAMC,CAAAA,CAAAA,CAAiCC,CACrD,CAAA,CAAA,GAAMC,CAAAA,CAA0C,CAAAC,aAAA,EAC9CC,oBAAsB,CAAA,CAAA,CAAA,EACnBH,CAEL,CAAA,CAAA,MAAO,UAA+BI,CAAAA,CAAkBC,GAEhDC,GAAEA,CAAAA,CAAWF,CAAAA,CAAAA,CAAbE,MAAAA,CACAC,CAAoBC,CAAAA,KAAAA,CAAMC,OAAQV,CAAAA,CAAAA,CAAAA,CAAgBA,CAAe,CAAA,CAACA,CAGxEK,CAAAA,CAAAA,CAAAA,CAAME,MAAS,CAAA,SAA2BI,CACxCH,CAAAA,KAAAA,KAAAA,MAAAA,CAAAA,CAAkBI,QAAQC,SAAAA,CACxB,CAAA,CAAA,GAAMC,CAAAA,CAAMD,CAAAA,CAAAA,CACZ,GAAIF,CAAAA,CAAaI,GAAID,CAAAA,CAAAA,CAAAA,CAAM,CACzB,GAAME,CAAAA,EAAWL,CAAAA,CAAAA,CAAaM,GAAIH,CAAAA,CAAAA,CAAAA,CAC5BI,EAAWC,CAAAA,KAAAA,CAAKL,GAElBE,EAAaE,GAAAA,EAAAA,GACVhB,CAAgBE,CAAAA,oBAAAA,EAAAA,CAAwBe,KAAKC,CAAAA,UAAAA,EAC/CD,KAAKb,CAAAA,CAAAA,CAAAA,CAA8CU,EAAUE,CAAAA,EAAAA,CAAAA,CAGnE,EAGHX,CAAAA,CAAAA,CAAAA,CAAAA,CAAOc,IAAKF,CAAAA,IAAAA,CAAMR,CACpB,CAAA,EAAC,EAEL"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["./nile-auto-complete.cjs.js","tslib","../index-
|
1
|
+
System.register(["./nile-auto-complete.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","lit","../watch.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileAutoCompleteCjsJs){_export("NileAutoComplete",_nileAutoCompleteCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_watchCjsJs){},function(_property002CjsJs){}],execute:function(){}};});
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
export{N as NileAutoComplete}from"./nile-auto-complete.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"../watch.esm.js";import"../property-09139d3c.esm.js";
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../watch.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var e,t,i,s,n,l,o,h,r,_templateObject,_templateObject2,_templateObject3,a;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return exports;};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value;},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key];}try{define({},"");}catch(err){define=function(obj,key,value){return obj[key]=value;};}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator;}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)};}catch(err){return{type:"throw",arg:err};}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this;});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg);});});}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==typeof value&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject);},function(err){invoke("throw",err,resolve,reject);}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result);},function(error){return invoke("throw",error,resolve,reject);});}reject(record.arg);}var previousPromise;defineProperty(this,"_invoke",{value:function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject);});}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult();}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult;}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg);}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done};}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg);}};}function maybeInvokeDelegate(delegate,context){var methodName=context.method,method=delegate.iterator[methodName];if(undefined===method)return context.delegate=null,"throw"===methodName&&delegate.iterator.return&&(context.method="return",context.arg=undefined,maybeInvokeDelegate(delegate,context),"throw"===context.method)||"return"!==methodName&&(context.method="throw",context.arg=new TypeError("The iterator does not provide a '"+methodName+"' method")),ContinueSentinel;var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=undefined),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel);}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry);}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record;}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0);}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=undefined,next.done=!0,next;};return next.next=next;}}return{next:doneResult};}function doneResult(){return{value:undefined,done:!0};}return GeneratorFunction.prototype=GeneratorFunctionPrototype,defineProperty(Gp,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),defineProperty(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name));},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun;},exports.awrap=function(arg){return{__await:arg};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this;}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next();});},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this;}),define(Gp,"toString",function(){return"[object Generator]";}),exports.keys=function(val){var object=Object(val),keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next;}return next.done=!0,next;};},exports.values=values,Context.prototype={constructor:Context,reset:function(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=undefined);},stop:function(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval;},dispatchException:function(exception){if(this.done)throw exception;var context=this;function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=undefined),!!caught;}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}else if(hasCatch){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);}else{if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}}}},abrupt:function(type,arg){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break;}}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record);},complete:function(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel;},finish:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel;}},catch:function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry);}return thrown;}}throw new Error("illegal catch attempt");},delegateYield:function(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=undefined),ContinueSentinel;}},exports;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_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(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.y;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;n=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_watchCjsJs){h=_watchCjsJs.w;},function(_property002CjsJs){r=_property002CjsJs.e;},function(_lit){}],execute:function(){a=/*#__PURE__*/function(_o){_inherits(a,_o);var _super=_createSuper(a);function a(){var _this;_classCallCheck(this,a);_this=_super.apply(this,arguments),_this.isDropdownOpen=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.menuItems=[],_this.allMenuItems=[];return _this;}_createClass(a,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(a.prototype),"connectedCallback",this).call(this),this.menuItems=_toConsumableArray(this.allMenuItems);}},{key:"handleAllMenuItemsChange",value:function handleAllMenuItemsChange(){this.menuItems=_toConsumableArray(this.allMenuItems);}},{key:"handleValueChange",value:function(){var _handleValueChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this2=this;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this.updateComplete;case 2:this.menuItems=this.allMenuItems.filter(function(e){var _this2$value;return e.toLowerCase().includes((_this2$value=_this2.value)===null||_this2$value===void 0?void 0:_this2$value.toLowerCase());});case 3:case"end":return _context2.stop();}},_callee,this);}));function handleValueChange(){return _handleValueChange.apply(this,arguments);}return handleValueChange;}()},{key:"handleSelect",value:function handleSelect(e){var _this$dropdownElement;this.value=e.detail.value,this.emit("nile-complete",{value:e.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide();}},{key:"handleSearch",value:function handleSearch(e){var _this$dropdownElement2;var t=e.detail.value.toLowerCase();this.value=t,this.menuItems=this.allMenuItems.filter(function(e){return e===null||e===void 0?void 0:e.toLowerCase().includes(t);}),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.show());}},{key:"handleFocus",value:function handleFocus(){var _this3=this;this.openOnFocus&&setTimeout(function(){var _this3$dropdownElemen;_this3.isDropdownOpen=!0,(_this3$dropdownElemen=_this3.dropdownElement)===null||_this3$dropdownElemen===void 0?void 0:_this3$dropdownElemen.show();},300);}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement3;this.isDropdownOpen=!0,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.show();}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick>\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n ></nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.menuItems.length>0?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-menu @nile-select=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.menuItems.map(function(e){return t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,e);})):"");}}]);return a;}(o);a.styles=l,e([r({type:Boolean})],a.prototype,"isDropdownOpen",void 0),e([r({type:Boolean})],a.prototype,"openOnFocus",void 0),e([r({type:String})],a.prototype,"value",void 0),e([r({type:String})],a.prototype,"placeholder",void 0),e([r({type:Boolean})],a.prototype,"noBorder",void 0),e([i()],a.prototype,"menuItems",void 0),e([r({type:Array})],a.prototype,"allMenuItems",void 0),e([s("nile-dropdown")],a.prototype,"dropdownElement",void 0),e([h("allMenuItems")],a.prototype,"handleAllMenuItemsChange",null),e([h("value",{waitUntilFirstUpdate:!0}),h("isDropdownOpen",{waitUntilFirstUpdate:!0})],a.prototype,"handleValueChange",null),a=e([n("nile-auto-complete")],a);}};});
|
1
|
+
System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../watch.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,t,i,s,n,l,o,h,r,_templateObject,_templateObject2,_templateObject3,a;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){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(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(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 new 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(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(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function(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 new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function(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(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(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(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 new Error("illegal catch attempt");},delegateYield:function(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_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(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;n=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_watchCjsJs){h=_watchCjsJs.w;},function(_property002CjsJs){r=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",a=/*#__PURE__*/function(_o){_inherits(a,_o);var _super=_createSuper(a);function a(){var _this;_classCallCheck(this,a);_this=_super.apply(this,arguments),_this.isDropdownOpen=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.menuItems=[],_this.allMenuItems=[];return _this;}_createClass(a,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(a.prototype),"connectedCallback",this).call(this),this.menuItems=_toConsumableArray(this.allMenuItems);}},{key:"handleAllMenuItemsChange",value:function handleAllMenuItemsChange(){this.menuItems=_toConsumableArray(this.allMenuItems);}},{key:"handleValueChange",value:function(){var _handleValueChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this2=this;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this.updateComplete;case 2:this.menuItems=this.allMenuItems.filter(function(e){var _this2$value;return e.toLowerCase().includes((_this2$value=_this2.value)===null||_this2$value===void 0?void 0:_this2$value.toLowerCase());});case 3:case"end":return _context2.stop();}},_callee,this);}));function handleValueChange(){return _handleValueChange.apply(this,arguments);}return handleValueChange;}()},{key:"handleSelect",value:function handleSelect(e){var _this$dropdownElement;this.value=e.detail.value,this.emit("nile-complete",{value:e.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide();}},{key:"handleSearch",value:function handleSearch(e){var _this$dropdownElement2;var t=e.detail.value.toLowerCase();this.value=t,this.menuItems=this.allMenuItems.filter(function(e){return e===null||e===void 0?void 0:e.toLowerCase().includes(t);}),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.show());}},{key:"handleFocus",value:function handleFocus(){var _this3=this;this.openOnFocus&&setTimeout(function(){var _this3$dropdownElemen;_this3.isDropdownOpen=!0,(_this3$dropdownElemen=_this3.dropdownElement)===null||_this3$dropdownElemen===void 0?void 0:_this3$dropdownElemen.show();},300);}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement3;this.isDropdownOpen=!0,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.show();}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick>\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n ></nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.menuItems.length>0?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-menu @nile-select=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.menuItems.map(function(e){return t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,e);})):"");}}]);return a;}(o));a.styles=l,e([r({type:Boolean})],a.prototype,"isDropdownOpen",void 0),e([r({type:Boolean})],a.prototype,"openOnFocus",void 0),e([r({type:String})],a.prototype,"value",void 0),e([r({type:String})],a.prototype,"placeholder",void 0),e([r({type:Boolean})],a.prototype,"noBorder",void 0),e([i()],a.prototype,"menuItems",void 0),e([r({type:Array})],a.prototype,"allMenuItems",void 0),e([s("nile-dropdown")],a.prototype,"dropdownElement",void 0),e([h("allMenuItems")],a.prototype,"handleAllMenuItemsChange",null),e([h("value",{waitUntilFirstUpdate:!0}),h("isDropdownOpen",{waitUntilFirstUpdate:!0})],a.prototype,"handleValueChange",null),_export("N",a=e([n("nile-auto-complete")],a));}};});
|
2
2
|
//# sourceMappingURL=nile-auto-complete.cjs.js.map
|