@usecapsule/core-components 1.0.13 → 2.0.0-dev.dropdown
Sign up to get free protection for your applications and to get access to all the features.
- package/css/capsule-core.css +86 -41
- package/css/capsule-core.css.map +1 -1
- package/dist/capsule/capsule.esm.js +1 -1
- package/dist/capsule/capsule.esm.js.map +1 -1
- package/dist/capsule/index.esm.js +1 -1
- package/dist/capsule/index.esm.js.map +1 -1
- package/dist/capsule/p-0462f723.js +2 -0
- package/dist/capsule/p-0462f723.js.map +1 -0
- package/dist/capsule/p-0cab90fa.entry.js +2 -0
- package/dist/capsule/{p-1dc07cd7.entry.js.map → p-0cab90fa.entry.js.map} +1 -1
- package/dist/capsule/{p-11048392.entry.js → p-193ac141.entry.js} +2 -2
- package/dist/capsule/p-6fb7c4d1.js +3 -0
- package/dist/capsule/p-6fb7c4d1.js.map +1 -0
- package/dist/capsule/{p-62e7869a.entry.js → p-a95ec4df.entry.js} +2 -2
- package/dist/capsule/p-bea93fae.entry.js +29 -0
- package/dist/capsule/p-bea93fae.entry.js.map +1 -0
- package/dist/capsule/p-c2bf050b.js +2 -0
- package/dist/capsule/p-c2bf050b.js.map +1 -0
- package/dist/capsule/p-cb8dc0a4.entry.js +2 -0
- package/dist/capsule/p-d7be092d.entry.js +10 -0
- package/dist/capsule/p-d7be092d.entry.js.map +1 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js +12 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/dist/cjs/capsule.cjs.js +2 -2
- package/dist/cjs/constants-4bb85cc5.js +12 -0
- package/dist/cjs/constants-4bb85cc5.js.map +1 -0
- package/dist/cjs/{cpsl-alert_17.cjs.entry.js → cpsl-alert_18.cjs.entry.js} +3838 -537
- package/dist/cjs/cpsl-alert_18.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js +20129 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
- package/dist/cjs/cpsl-info-box.cjs.entry.js +3 -3
- package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
- package/dist/cjs/{index-2a026742.js → index-3fccb5b4.js} +24 -3
- package/dist/cjs/index-3fccb5b4.js.map +1 -0
- package/dist/cjs/index.cjs.js +358 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/icons/capsule-rings-dark.svg +34 -0
- package/dist/collection/assets/icons/capsule.svg +4 -4
- package/dist/collection/assets/icons/chevron-up.svg +3 -0
- package/dist/collection/assets/icons/hero-email.svg +8 -30
- package/dist/collection/assets/icons/hero-lock.svg +4 -34
- package/dist/collection/assets/icons/hero-passkey.svg +9 -17
- package/dist/collection/assets/icons/hero-phone.svg +4 -15
- package/dist/collection/assets/icons/hero-wallet.svg +5 -44
- package/dist/collection/assets/icons/index.js +5 -2
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/assets/icons/more-login-options.svg +10 -10
- package/dist/collection/assets/icons/plus-circle.svg +5 -0
- package/dist/collection/assets/icons/wallet.svg +5 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +1 -1
- package/dist/collection/components/cpsl-animation/cpsl-animation.css +17 -0
- package/dist/collection/components/cpsl-animation/cpsl-animation.js +102 -0
- package/dist/collection/components/cpsl-animation/cpsl-animation.js.map +1 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js +29 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js +37 -0
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js.map +1 -0
- package/dist/collection/components/cpsl-button/cpsl-button.css +3 -0
- package/dist/collection/components/cpsl-button/cpsl-button.js +2 -2
- package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +1 -1
- package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.css +88 -0
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +113 -0
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -0
- package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js +29 -0
- package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js +37 -0
- package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js.map +1 -0
- package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
- package/dist/collection/components/cpsl-icon/cpsl-icon.css +14 -0
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -3
- package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.css +12 -7
- package/dist/collection/components/cpsl-input/cpsl-input.js +8 -6
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
- package/dist/collection/components/cpsl-modal/cpsl-modal.css +46 -4
- package/dist/collection/components/cpsl-modal/cpsl-modal.js +341 -24
- package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +30 -13
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
- package/dist/collection/components/cpsl-pill/cpsl-pill.css +3 -3
- package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
- package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.css +3 -3
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +3 -3
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
- package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.css +11 -9
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +2 -2
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
- package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +17 -16
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +2 -2
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
- package/dist/collection/components/cpsl-text/cpsl-text.css +101 -0
- package/dist/collection/components/cpsl-text/cpsl-text.js +110 -1
- package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -0
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
- package/dist/collection/constants.js +6 -0
- package/dist/collection/constants.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/interface.js.map +1 -1
- package/dist/collection/utils/theme/generateBorderRadii.js +56 -0
- package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -0
- package/dist/collection/utils/theme/generateFont.js +28 -0
- package/dist/collection/utils/theme/generateFont.js.map +1 -0
- package/dist/collection/utils/theme/generatePalette.js +46 -0
- package/dist/collection/utils/theme/generatePalette.js.map +1 -0
- package/dist/collection/utils/theme/generateTheme.js +11 -0
- package/dist/collection/utils/theme/generateTheme.js.map +1 -0
- package/dist/collection/utils/theme/utils.js +21 -0
- package/dist/collection/utils/theme/utils.js.map +1 -0
- package/dist/esm/_commonjsHelpers-1789f0cf.js +9 -0
- package/dist/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/dist/esm/capsule.js +3 -3
- package/dist/esm/constants-7b49abd5.js +9 -0
- package/dist/esm/constants-7b49abd5.js.map +1 -0
- package/dist/esm/{cpsl-alert_17.entry.js → cpsl-alert_18.entry.js} +3837 -537
- package/dist/esm/cpsl-alert_18.entry.js.map +1 -0
- package/dist/esm/cpsl-animation.entry.js +20125 -0
- package/dist/esm/cpsl-animation.entry.js.map +1 -0
- package/dist/esm/cpsl-col.entry.js +2 -2
- package/dist/esm/cpsl-grid.entry.js +3 -3
- package/dist/esm/cpsl-info-box.entry.js +3 -3
- package/dist/esm/cpsl-info-box.entry.js.map +1 -1
- package/dist/esm/cpsl-row.entry.js +2 -2
- package/dist/esm/{index-7c2f5cb9.js → index-f00e090c.js} +24 -3
- package/dist/esm/index-f00e090c.js.map +1 -0
- package/dist/esm/index.js +355 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/assets/icons/index.d.ts +4 -1
- package/dist/types/components/cpsl-animation/cpsl-animation.d.ts +9 -0
- package/dist/types/components/cpsl-dropdown/cpsl-dropdown.d.ts +25 -0
- package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +26 -5
- package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +2 -2
- package/dist/types/components/cpsl-text/cpsl-text.d.ts +4 -0
- package/dist/types/components.d.ts +170 -13
- package/dist/types/constants.d.ts +3 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/interface.d.ts +137 -0
- package/dist/types/utils/theme/generateBorderRadii.d.ts +2 -0
- package/dist/types/utils/theme/generateFont.d.ts +2 -0
- package/dist/types/utils/theme/generatePalette.d.ts +7 -0
- package/dist/types/utils/theme/generateTheme.d.ts +2 -0
- package/dist/types/utils/theme/utils.d.ts +5 -0
- package/package.json +5 -3
- package/dist/capsule/p-0e2fbb7f.entry.js +0 -20
- package/dist/capsule/p-0e2fbb7f.entry.js.map +0 -1
- package/dist/capsule/p-1dc07cd7.entry.js +0 -2
- package/dist/capsule/p-5c020abe.entry.js +0 -2
- package/dist/capsule/p-9647dd63.js +0 -3
- package/dist/capsule/p-9647dd63.js.map +0 -1
- package/dist/cjs/cpsl-alert_17.cjs.entry.js.map +0 -1
- package/dist/cjs/index-2a026742.js.map +0 -1
- package/dist/collection/assets/icons/more-login-options-dark.svg +0 -13
- package/dist/esm/cpsl-alert_17.entry.js.map +0 -1
- package/dist/esm/index-7c2f5cb9.js.map +0 -1
- /package/dist/capsule/{p-11048392.entry.js.map → p-193ac141.entry.js.map} +0 -0
- /package/dist/capsule/{p-62e7869a.entry.js.map → p-a95ec4df.entry.js.map} +0 -0
- /package/dist/capsule/{p-5c020abe.entry.js.map → p-cb8dc0a4.entry.js.map} +0 -0
- /package/dist/types/Users/{taylorbosch → vinay}/Documents/GitHub/Capsule/component-library/core/.stencil/scripts/buildIconLibrary.d.ts +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AASrG,MAAM,OAAO,SAAS;;QAGZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QAwPrC,YAAO,GAAG,CAAC,EAAsB,EAAE,EAAE;YAC3C,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC/B,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAChE,CAAC;YACD,IAAI,CAAC,eAAe,CAAC,EAAE,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n componentDidLoad() {\n if (Boolean(this.value)) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.el.querySelector('[slot=\"end\"]').setAttribute('disabled', 'true');\n this.el.querySelector('[slot=\"start\"]').setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.el.querySelector('[slot=\"end\"]').setAttribute('disabled', 'false');\n this.el.querySelector('[slot=\"start\"]').setAttribute('disabled', 'false');\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.cpslInput.emit({ value: newValue, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent | Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (Boolean(input)) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get nativeInput() {\n return this.el.shadowRoot.getElementById(this.inputId);\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <div onClick={this.focusInput} class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <cpsl-icon icon={Boolean(this.errorText) ? 'alertCircle' : 'infoCircle'} />\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>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ldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n componentDidLoad() {\n if (Boolean(this.value)) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.el.querySelector('[slot=\"end\"]')?.setAttribute('disabled', 'true');\n this.el.querySelector('[slot=\"start\"]')?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.el.querySelector('[slot=\"end\"]')?.setAttribute('disabled', 'false');\n this.el.querySelector('[slot=\"start\"]')?.setAttribute('disabled', 'false');\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.cpslInput.emit({ value: newValue, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent | Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (Boolean(input)) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get nativeInput() {\n return this.el.shadowRoot.getElementById(this.inputId);\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <div onClick={this.focusInput} class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <cpsl-icon icon={Boolean(this.errorText) ? 'alertCircle' : 'infoCircle'} />\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
@@ -73,7 +73,47 @@
|
|
73
73
|
display: inline-block;
|
74
74
|
}
|
75
75
|
|
76
|
+
@media (max-width: 480px) {
|
77
|
+
:host(.include-mobile-styling) .modal-wrapper {
|
78
|
+
scale: none;
|
79
|
+
top: 100%;
|
80
|
+
left: 0;
|
81
|
+
height: unset;
|
82
|
+
opacity: 1;
|
83
|
+
}
|
84
|
+
:host(.include-mobile-styling) .modal-container {
|
85
|
+
width: 100%;
|
86
|
+
max-width: none;
|
87
|
+
border-bottom-left-radius: 0px;
|
88
|
+
border-bottom-right-radius: 0px;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
.modal-header {
|
93
|
+
position: sticky;
|
94
|
+
top: 0;
|
95
|
+
padding-top: var(--inner-container-padding-top);
|
96
|
+
background-color: var(--inner-container-background-color);
|
97
|
+
}
|
98
|
+
|
99
|
+
.modal-wrapper {
|
100
|
+
z-index: 9999999999998;
|
101
|
+
position: fixed;
|
102
|
+
top: 0;
|
103
|
+
left: 0;
|
104
|
+
display: none;
|
105
|
+
height: 100%;
|
106
|
+
width: 100%;
|
107
|
+
justify-content: center;
|
108
|
+
align-items: center;
|
109
|
+
scale: 0.8;
|
110
|
+
opacity: 0;
|
111
|
+
transform: none;
|
112
|
+
}
|
113
|
+
|
76
114
|
.modal-container {
|
115
|
+
position: relative;
|
116
|
+
overflow: hidden;
|
77
117
|
-webkit-padding-start: var(--container-padding-start);
|
78
118
|
padding-inline-start: var(--container-padding-start);
|
79
119
|
-webkit-padding-end: var(--container-padding-end);
|
@@ -104,12 +144,9 @@
|
|
104
144
|
padding-inline-start: var(--inner-container-padding-start);
|
105
145
|
-webkit-padding-end: var(--inner-container-padding-end);
|
106
146
|
padding-inline-end: var(--inner-container-padding-end);
|
107
|
-
padding-top:
|
147
|
+
padding-top: 0;
|
108
148
|
padding-bottom: var(--inner-container-padding-bottom);
|
109
149
|
margin-bottom: var(--inner-container-margin-bottom);
|
110
|
-
display: flex;
|
111
|
-
flex-direction: column;
|
112
|
-
flex: 1;
|
113
150
|
border-radius: var(--inner-container-border-radius);
|
114
151
|
box-shadow: var(--inner-container-box-shadow);
|
115
152
|
background-color: var(--inner-container-background-color);
|
@@ -118,6 +155,7 @@
|
|
118
155
|
.expanded {
|
119
156
|
height: 0px;
|
120
157
|
overflow: hidden;
|
158
|
+
display: none;
|
121
159
|
}
|
122
160
|
|
123
161
|
.modal-inner-container.no-footer {
|
@@ -127,4 +165,8 @@
|
|
127
165
|
|
128
166
|
.modal-container.no-footer {
|
129
167
|
padding-bottom: 0px;
|
168
|
+
}
|
169
|
+
|
170
|
+
.no-opacity {
|
171
|
+
opacity: 0;
|
130
172
|
}
|
@@ -1,28 +1,169 @@
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
2
2
|
import gsap from "gsap";
|
3
|
+
import Draggable from "gsap/Draggable";
|
4
|
+
import { MOBILE_SIZE } from "../../constants";
|
5
|
+
gsap.registerPlugin(Draggable);
|
6
|
+
const mm = gsap.matchMedia();
|
3
7
|
export class CpslModal {
|
4
8
|
constructor() {
|
5
|
-
this.
|
9
|
+
this.getDraggableHeight = () => {
|
10
|
+
return this.innerContainerEl.clientHeight;
|
11
|
+
};
|
12
|
+
this.hasFooter = undefined;
|
13
|
+
this.enterTransitionDuration = 0.15;
|
14
|
+
this.exitTransitionDuration = 0.15;
|
6
15
|
this.footerExpanded = undefined;
|
7
|
-
this.
|
16
|
+
this.footerTransitionDuration = 0.15;
|
17
|
+
this.noOverlay = undefined;
|
18
|
+
this.open = undefined;
|
8
19
|
}
|
9
20
|
toggleHeight() {
|
10
21
|
this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();
|
11
22
|
}
|
12
|
-
|
13
|
-
if (
|
14
|
-
|
23
|
+
toggleModal() {
|
24
|
+
if (this.open) {
|
25
|
+
if (window.innerWidth >= MOBILE_SIZE + 1) {
|
26
|
+
gsap
|
27
|
+
.timeline({
|
28
|
+
onStart: () => {
|
29
|
+
this.cpslModalEntering.emit();
|
30
|
+
},
|
31
|
+
onComplete: () => {
|
32
|
+
this.addExpandAnim();
|
33
|
+
this.cpslModalEntered.emit();
|
34
|
+
},
|
35
|
+
})
|
36
|
+
.set(this.modalWrapperEl, { display: 'flex', yPercent: 0 })
|
37
|
+
.to(this.modalWrapperEl, {
|
38
|
+
scale: 1,
|
39
|
+
opacity: 1,
|
40
|
+
duration: this.enterTransitionDuration,
|
41
|
+
});
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
gsap
|
45
|
+
.timeline({
|
46
|
+
onStart: () => {
|
47
|
+
this.cpslModalEntering.emit();
|
48
|
+
},
|
49
|
+
onComplete: () => {
|
50
|
+
this.addExpandAnim();
|
51
|
+
this.cpslModalEntered.emit();
|
52
|
+
},
|
53
|
+
})
|
54
|
+
.set(this.modalWrapperEl, { display: 'flex', scale: 1, opacity: 1 })
|
55
|
+
.to(this.modalWrapperEl, {
|
56
|
+
yPercent: -100,
|
57
|
+
duration: this.enterTransitionDuration,
|
58
|
+
});
|
59
|
+
}
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
if (window.innerWidth >= MOBILE_SIZE + 1) {
|
63
|
+
gsap
|
64
|
+
.timeline({
|
65
|
+
onStart: () => {
|
66
|
+
this.cpslModalExiting.emit();
|
67
|
+
},
|
68
|
+
onComplete: () => {
|
69
|
+
this.cpslModalExited.emit();
|
70
|
+
this.modalWrapperEl.style.setProperty('display', 'none');
|
71
|
+
},
|
72
|
+
})
|
73
|
+
.to(this.modalWrapperEl, {
|
74
|
+
scale: 0.8,
|
75
|
+
opacity: 0,
|
76
|
+
duration: this.exitTransitionDuration,
|
77
|
+
});
|
78
|
+
}
|
79
|
+
else {
|
80
|
+
gsap
|
81
|
+
.timeline({
|
82
|
+
onStart: () => {
|
83
|
+
this.cpslModalExiting.emit();
|
84
|
+
},
|
85
|
+
onComplete: () => {
|
86
|
+
this.cpslModalExited.emit();
|
87
|
+
this.modalWrapperEl.style.setProperty('display', 'none');
|
88
|
+
},
|
89
|
+
})
|
90
|
+
.to(this.modalWrapperEl, {
|
91
|
+
yPercent: 0,
|
92
|
+
duration: this.exitTransitionDuration,
|
93
|
+
})
|
94
|
+
.set(this.modalContainerEl, { y: 0 });
|
95
|
+
}
|
15
96
|
}
|
16
|
-
this.expandFooterTl = gsap
|
17
|
-
.timeline({ reversed: true, paused: true })
|
18
|
-
.to(this.bodyEl, { height: '0px', duration: this.transitionDuration })
|
19
|
-
.to(this.footerEl, { height: '0px', duration: this.transitionDuration }, '<')
|
20
|
-
.to(this.footerExpandedEl, { height: 'auto', duration: this.transitionDuration }, '<')
|
21
|
-
.to(this.headerEl, { height: '0px', duration: this.transitionDuration }, '<')
|
22
|
-
.to(this.headerExpandedEl, { height: 'auto', duration: this.transitionDuration }, '<');
|
23
97
|
}
|
24
|
-
|
25
|
-
|
98
|
+
componentDidLoad() {
|
99
|
+
mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {
|
100
|
+
var _a;
|
101
|
+
(_a = this.draggable) === null || _a === void 0 ? void 0 : _a.disable();
|
102
|
+
gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });
|
103
|
+
});
|
104
|
+
mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {
|
105
|
+
this.initDraggable();
|
106
|
+
gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });
|
107
|
+
});
|
108
|
+
this.footerSlotEl.addEventListener('slotchange', () => {
|
109
|
+
if (this.footerSlotEl.assignedNodes().length >= 1) {
|
110
|
+
this.hasFooter = true;
|
111
|
+
}
|
112
|
+
else {
|
113
|
+
this.hasFooter = false;
|
114
|
+
}
|
115
|
+
});
|
116
|
+
}
|
117
|
+
addExpandAnim() {
|
118
|
+
setTimeout(() => {
|
119
|
+
this.expandFooterTl = gsap
|
120
|
+
.timeline({
|
121
|
+
reversed: true,
|
122
|
+
paused: true,
|
123
|
+
onReverseComplete: () => {
|
124
|
+
this.contentEl.style.setProperty('height', 'auto');
|
125
|
+
},
|
126
|
+
defaults: {
|
127
|
+
duration: this.footerTransitionDuration,
|
128
|
+
},
|
129
|
+
})
|
130
|
+
.set(this.footerExpandedEl, { overflow: 'auto', display: 'block' })
|
131
|
+
.set(this.headerExpandedEl, { display: 'block' })
|
132
|
+
.to(this.innerContainerEl, { paddingBottom: '8px' })
|
133
|
+
.to(this.contentEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')
|
134
|
+
.to(this.footerEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')
|
135
|
+
.to(this.footerExpandedEl, { height: 'auto', opacity: 1 }, '<')
|
136
|
+
.to(this.headerExpandedEl, { height: 'auto', opacity: 1 }, '<');
|
137
|
+
}, 10);
|
138
|
+
}
|
139
|
+
initDraggable() {
|
140
|
+
this.draggable = Draggable.create(this.modalContainerEl, {
|
141
|
+
trigger: this.headerEl,
|
142
|
+
dragClickables: false,
|
143
|
+
type: 'y',
|
144
|
+
edgeResistance: 0.2,
|
145
|
+
liveSnap: {
|
146
|
+
y: function (y) {
|
147
|
+
if (y < 0)
|
148
|
+
return 0;
|
149
|
+
return y;
|
150
|
+
},
|
151
|
+
},
|
152
|
+
onDrag: () => {
|
153
|
+
const y = gsap.utils.mapRange(0, this.getDraggableHeight(), 1, 0, this.draggable.y);
|
154
|
+
gsap.set(this.overlayEl, { opacity: y });
|
155
|
+
},
|
156
|
+
onDragEnd: () => {
|
157
|
+
if (this.draggable.y > 60) {
|
158
|
+
this.cpslModalRequestClose.emit();
|
159
|
+
}
|
160
|
+
else {
|
161
|
+
gsap.set(this.overlayEl, { opacity: 1 });
|
162
|
+
gsap.set(this.modalWrapperEl, { yPercent: -100 });
|
163
|
+
gsap.set(this.modalContainerEl, { y: 0 });
|
164
|
+
}
|
165
|
+
},
|
166
|
+
})[0];
|
26
167
|
}
|
27
168
|
get footerEl() {
|
28
169
|
return this.el.shadowRoot.getElementById('modal-footer');
|
@@ -30,14 +171,39 @@ export class CpslModal {
|
|
30
171
|
get footerExpandedEl() {
|
31
172
|
return this.el.shadowRoot.getElementById('modal-footer-expanded');
|
32
173
|
}
|
174
|
+
get headerExpandedEl() {
|
175
|
+
return this.el.shadowRoot.getElementById('modal-header-expanded');
|
176
|
+
}
|
177
|
+
get innerContainerEl() {
|
178
|
+
return this.el.shadowRoot.getElementById('modal-inner-container');
|
179
|
+
}
|
180
|
+
get contentEl() {
|
181
|
+
return this.el.shadowRoot.getElementById('modal-content');
|
182
|
+
}
|
183
|
+
get modalWrapperEl() {
|
184
|
+
return this.el.shadowRoot.getElementById('modal-wrapper');
|
185
|
+
}
|
186
|
+
get modalContainerEl() {
|
187
|
+
return this.el.shadowRoot.getElementById('modal-container');
|
188
|
+
}
|
189
|
+
get overlayEl() {
|
190
|
+
return this.el.shadowRoot.getElementById('overlay');
|
191
|
+
}
|
192
|
+
get footerSlotEl() {
|
193
|
+
return this.footerEl.querySelectorAll('slot')[0];
|
194
|
+
}
|
33
195
|
get headerEl() {
|
34
196
|
return this.el.shadowRoot.getElementById('modal-header');
|
35
197
|
}
|
36
|
-
get
|
37
|
-
return this.
|
198
|
+
get Modal() {
|
199
|
+
return (h("div", { class: { 'modal-container': true, 'no-footer': !this.hasFooter }, part: "modal-container", id: "modal-container" }, h("slot", null), h("div", { id: "modal-inner-container", class: { 'modal-inner-container': true, 'no-footer': !this.hasFooter }, part: "modal-inner-container" }, h("div", { id: "modal-content", part: "modal-content" }, h("div", { id: "modal-header", class: "modal-header" }, h("slot", { name: "header" })), h("slot", { name: "body" })), h("div", { id: "modal-header-expanded", class: { 'modal-header': true, 'expanded': true, 'no-opacity': true } }, h("slot", { name: "footerExpandedHeader" }))), h("div", { id: "modal-footer" }, h("slot", { name: "footer" })), h("div", { id: "modal-footer-expanded", class: { 'expanded': true, 'no-opacity': true } }, h("slot", { name: "footerExpandedFooter" }))));
|
38
200
|
}
|
39
201
|
render() {
|
40
|
-
|
202
|
+
if (this.noOverlay) {
|
203
|
+
this.addExpandAnim();
|
204
|
+
return h(Host, null, this.Modal);
|
205
|
+
}
|
206
|
+
return (h(Host, { class: { 'include-mobile-styling': true } }, h("cpsl-overlay", { id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration }), h("div", { id: "modal-wrapper", class: "modal-wrapper" }, this.Modal)));
|
41
207
|
}
|
42
208
|
static get is() { return "cpsl-modal"; }
|
43
209
|
static get encapsulation() { return "shadow"; }
|
@@ -53,6 +219,42 @@ export class CpslModal {
|
|
53
219
|
}
|
54
220
|
static get properties() {
|
55
221
|
return {
|
222
|
+
"enterTransitionDuration": {
|
223
|
+
"type": "number",
|
224
|
+
"mutable": false,
|
225
|
+
"complexType": {
|
226
|
+
"original": "number",
|
227
|
+
"resolved": "number",
|
228
|
+
"references": {}
|
229
|
+
},
|
230
|
+
"required": false,
|
231
|
+
"optional": true,
|
232
|
+
"docs": {
|
233
|
+
"tags": [],
|
234
|
+
"text": "Duration in seconds of the modal entering.\nDefault is .15."
|
235
|
+
},
|
236
|
+
"attribute": "enter-transition-duration",
|
237
|
+
"reflect": false,
|
238
|
+
"defaultValue": "0.15"
|
239
|
+
},
|
240
|
+
"exitTransitionDuration": {
|
241
|
+
"type": "number",
|
242
|
+
"mutable": false,
|
243
|
+
"complexType": {
|
244
|
+
"original": "number",
|
245
|
+
"resolved": "number",
|
246
|
+
"references": {}
|
247
|
+
},
|
248
|
+
"required": false,
|
249
|
+
"optional": true,
|
250
|
+
"docs": {
|
251
|
+
"tags": [],
|
252
|
+
"text": "Duration in seconds of the modal exiting.\nDefault is .15."
|
253
|
+
},
|
254
|
+
"attribute": "exit-transition-duration",
|
255
|
+
"reflect": false,
|
256
|
+
"defaultValue": "0.15"
|
257
|
+
},
|
56
258
|
"footerExpanded": {
|
57
259
|
"type": "boolean",
|
58
260
|
"mutable": false,
|
@@ -62,7 +264,7 @@ export class CpslModal {
|
|
62
264
|
"references": {}
|
63
265
|
},
|
64
266
|
"required": false,
|
65
|
-
"optional":
|
267
|
+
"optional": true,
|
66
268
|
"docs": {
|
67
269
|
"tags": [],
|
68
270
|
"text": "Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots."
|
@@ -70,7 +272,7 @@ export class CpslModal {
|
|
70
272
|
"attribute": "footer-expanded",
|
71
273
|
"reflect": false
|
72
274
|
},
|
73
|
-
"
|
275
|
+
"footerTransitionDuration": {
|
74
276
|
"type": "number",
|
75
277
|
"mutable": false,
|
76
278
|
"complexType": {
|
@@ -79,27 +281,142 @@ export class CpslModal {
|
|
79
281
|
"references": {}
|
80
282
|
},
|
81
283
|
"required": false,
|
82
|
-
"optional":
|
284
|
+
"optional": true,
|
83
285
|
"docs": {
|
84
286
|
"tags": [],
|
85
|
-
"text": "Duration in seconds of the footer expansion animation.\nDefault is .
|
287
|
+
"text": "Duration in seconds of the footer expansion animation.\nDefault is 0.15."
|
86
288
|
},
|
87
|
-
"attribute": "transition-duration",
|
289
|
+
"attribute": "footer-transition-duration",
|
88
290
|
"reflect": false,
|
89
|
-
"defaultValue": "0.
|
291
|
+
"defaultValue": "0.15"
|
292
|
+
},
|
293
|
+
"noOverlay": {
|
294
|
+
"type": "boolean",
|
295
|
+
"mutable": false,
|
296
|
+
"complexType": {
|
297
|
+
"original": "boolean",
|
298
|
+
"resolved": "boolean",
|
299
|
+
"references": {}
|
300
|
+
},
|
301
|
+
"required": false,
|
302
|
+
"optional": true,
|
303
|
+
"docs": {
|
304
|
+
"tags": [],
|
305
|
+
"text": "Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`."
|
306
|
+
},
|
307
|
+
"attribute": "no-overlay",
|
308
|
+
"reflect": false
|
309
|
+
},
|
310
|
+
"open": {
|
311
|
+
"type": "boolean",
|
312
|
+
"mutable": false,
|
313
|
+
"complexType": {
|
314
|
+
"original": "boolean",
|
315
|
+
"resolved": "boolean",
|
316
|
+
"references": {}
|
317
|
+
},
|
318
|
+
"required": false,
|
319
|
+
"optional": false,
|
320
|
+
"docs": {
|
321
|
+
"tags": [],
|
322
|
+
"text": "Whether or not to show the modal."
|
323
|
+
},
|
324
|
+
"attribute": "open",
|
325
|
+
"reflect": false
|
90
326
|
}
|
91
327
|
};
|
92
328
|
}
|
93
329
|
static get states() {
|
94
330
|
return {
|
95
|
-
"
|
331
|
+
"hasFooter": {}
|
96
332
|
};
|
97
333
|
}
|
334
|
+
static get events() {
|
335
|
+
return [{
|
336
|
+
"method": "cpslModalEntering",
|
337
|
+
"name": "cpslModalEntering",
|
338
|
+
"bubbles": true,
|
339
|
+
"cancelable": true,
|
340
|
+
"composed": true,
|
341
|
+
"docs": {
|
342
|
+
"tags": [],
|
343
|
+
"text": "Emitted when enter animation starts."
|
344
|
+
},
|
345
|
+
"complexType": {
|
346
|
+
"original": "null",
|
347
|
+
"resolved": "null",
|
348
|
+
"references": {}
|
349
|
+
}
|
350
|
+
}, {
|
351
|
+
"method": "cpslModalEntered",
|
352
|
+
"name": "cpslModalEntered",
|
353
|
+
"bubbles": true,
|
354
|
+
"cancelable": true,
|
355
|
+
"composed": true,
|
356
|
+
"docs": {
|
357
|
+
"tags": [],
|
358
|
+
"text": "Emitted when enter animation finishes."
|
359
|
+
},
|
360
|
+
"complexType": {
|
361
|
+
"original": "null",
|
362
|
+
"resolved": "null",
|
363
|
+
"references": {}
|
364
|
+
}
|
365
|
+
}, {
|
366
|
+
"method": "cpslModalExiting",
|
367
|
+
"name": "cpslModalExiting",
|
368
|
+
"bubbles": true,
|
369
|
+
"cancelable": true,
|
370
|
+
"composed": true,
|
371
|
+
"docs": {
|
372
|
+
"tags": [],
|
373
|
+
"text": "Emitted when exit animation starts."
|
374
|
+
},
|
375
|
+
"complexType": {
|
376
|
+
"original": "null",
|
377
|
+
"resolved": "null",
|
378
|
+
"references": {}
|
379
|
+
}
|
380
|
+
}, {
|
381
|
+
"method": "cpslModalExited",
|
382
|
+
"name": "cpslModalExited",
|
383
|
+
"bubbles": true,
|
384
|
+
"cancelable": true,
|
385
|
+
"composed": true,
|
386
|
+
"docs": {
|
387
|
+
"tags": [],
|
388
|
+
"text": "Emitted when exit animation finishes."
|
389
|
+
},
|
390
|
+
"complexType": {
|
391
|
+
"original": "null",
|
392
|
+
"resolved": "null",
|
393
|
+
"references": {}
|
394
|
+
}
|
395
|
+
}, {
|
396
|
+
"method": "cpslModalRequestClose",
|
397
|
+
"name": "cpslModalRequestClose",
|
398
|
+
"bubbles": true,
|
399
|
+
"cancelable": true,
|
400
|
+
"composed": true,
|
401
|
+
"docs": {
|
402
|
+
"tags": [],
|
403
|
+
"text": "Emitted when exit animation finishes."
|
404
|
+
},
|
405
|
+
"complexType": {
|
406
|
+
"original": "null",
|
407
|
+
"resolved": "null",
|
408
|
+
"references": {}
|
409
|
+
}
|
410
|
+
}];
|
411
|
+
}
|
98
412
|
static get elementRef() { return "el"; }
|
99
413
|
static get watchers() {
|
100
414
|
return [{
|
101
415
|
"propName": "footerExpanded",
|
102
416
|
"methodName": "toggleHeight"
|
417
|
+
}, {
|
418
|
+
"propName": "open",
|
419
|
+
"methodName": "toggleModal"
|
103
420
|
}];
|
104
421
|
}
|
105
422
|
}
|