@mhmo91/schmancy 0.2.113 → 0.2.114
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/dist/{autocomplete-Du2Jw0a2.cjs → autocomplete-BU0sC_l-.cjs} +2 -2
- package/dist/autocomplete-BU0sC_l-.cjs.map +1 -0
- package/dist/{autocomplete-NL-c1Qp-.js → autocomplete-u76bIDqg.js} +29 -29
- package/dist/autocomplete-u76bIDqg.js.map +1 -0
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{chips-Ctk7cxHI.js → chips-DTDFQDv-.js} +12 -12
- package/dist/{chips-Ctk7cxHI.js.map → chips-DTDFQDv-.js.map} +1 -1
- package/dist/chips.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{delay-NkgyZVcO.cjs → delay-Dzei5ynQ.cjs} +2 -2
- package/dist/{delay-NkgyZVcO.cjs.map → delay-Dzei5ynQ.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/extra.cjs +2 -0
- package/dist/extra.cjs.map +1 -0
- package/dist/extra.js +6 -0
- package/dist/extra.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +61 -58
- package/dist/index.js.map +1 -1
- package/dist/input-CTC1BTOb.cjs +51 -0
- package/dist/input-CTC1BTOb.cjs.map +1 -0
- package/dist/input-CZX1sxBe.js +135 -0
- package/dist/input-CZX1sxBe.js.map +1 -0
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/{option-_1gW48HB.js → option-CxalubCR.js} +18 -8
- package/dist/option-CxalubCR.js.map +1 -0
- package/dist/option-DJLLszO6.cjs +18 -0
- package/dist/option-DJLLszO6.cjs.map +1 -0
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/rxjs-utils.js +4 -4
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-CF-USarR.cjs → teleport.component-C9Q1WHQe.cjs} +2 -2
- package/dist/{teleport.component-CF-USarR.cjs.map → teleport.component-C9Q1WHQe.cjs.map} +1 -1
- package/dist/{teleport.component-D8DXijGl.js → teleport.component-DY1Q8ilK.js} +11 -10
- package/dist/{teleport.component-D8DXijGl.js.map → teleport.component-DY1Q8ilK.js.map} +1 -1
- package/dist/teleport.js +1 -1
- package/dist/timezone-Cv2QSsl4.cjs +24 -0
- package/dist/timezone-Cv2QSsl4.cjs.map +1 -0
- package/dist/timezone-EDGZdfbO.js +67 -0
- package/dist/timezone-EDGZdfbO.js.map +1 -0
- package/dist/{typewriter-bnkFoDFz.js → typewriter-C1Ij3c--.js} +11 -11
- package/dist/{typewriter-bnkFoDFz.js.map → typewriter-C1Ij3c--.js.map} +1 -1
- package/dist/{typewriter-CzV1O28F.cjs → typewriter-DtWpV0Xd.cjs} +2 -2
- package/dist/{typewriter-CzV1O28F.cjs.map → typewriter-DtWpV0Xd.cjs.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/package.json +1 -1
- package/types/src/extra/countries/countries.d.ts +13 -0
- package/types/src/extra/countries/countries.data.d.ts +5 -0
- package/types/src/extra/countries/index.d.ts +2 -0
- package/types/src/extra/index.d.ts +2 -0
- package/types/src/extra/timezone/index.d.ts +2 -0
- package/types/src/extra/timezone/timezone.d.ts +13 -0
- package/types/src/extra/timezone/timezones.data.d.ts +7 -0
- package/types/src/index.d.ts +1 -1
- package/types/src/option/option.d.ts +1 -0
- package/dist/autocomplete-Du2Jw0a2.cjs.map +0 -1
- package/dist/autocomplete-NL-c1Qp-.js.map +0 -1
- package/dist/data.cjs +0 -2
- package/dist/data.cjs.map +0 -1
- package/dist/data.js +0 -2
- package/dist/data.js.map +0 -1
- package/dist/input-CszLZ81k.cjs +0 -51
- package/dist/input-CszLZ81k.cjs.map +0 -1
- package/dist/input-CwWLOBMF.js +0 -135
- package/dist/input-CwWLOBMF.js.map +0 -1
- package/dist/option-0le6-QeS.cjs +0 -18
- package/dist/option-0le6-QeS.cjs.map +0 -1
- package/dist/option-_1gW48HB.js.map +0 -1
package/dist/data.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/data.js
DELETED
package/dist/data.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/input-CszLZ81k.cjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("lit"),i=require("lit/decorators.js"),m=require("lit/directives/class-map.js"),n=require("lit/directives/if-defined.js"),f=require("lit/directives/ref.js"),b=require("lit/directives/when.js"),s=require("rxjs");require("lit/directives/style-map.js");const v=require("./tailwind.mixin-CBhPue3q.cjs"),y=require("./ripple-C2BHbhcS.cjs"),h=require("./theme.interface-Xg5Zi46a.cjs");var g=Object.defineProperty,$=Object.getOwnPropertyDescriptor,r=(e,o,a,l)=>{for(var u,p=l>1?void 0:l?$(o,a):o,d=e.length-1;d>=0;d--)(u=e[d])&&(p=(l?u(o,a,p):u(p))||p);return l&&p&&g(o,a,p),p};let t=class extends v.TailwindElement(){constructor(){if(super(),this.id="",this.label="",this.type="text",this.name=`name_${Date.now()}`,this.placeholder="",this.value="",this.required=!1,this.disabled=!1,this.readonly=!1,this.clickable=!1,this.spellcheck=!1,this.align="left",this.autofocus=!1,this.autocomplete="on",this.tabIndex=0,this.error=!1,this.inputRef=f.createRef(),"attachInternals"in this)try{this.internals=this.attachInternals()}catch{this.internals=void 0}}willUpdate(e){this.id||(this.id="schmancy-input-"+t._idCounter++),super.willUpdate(e)}get form(){var e;return((e=this.internals)==null?void 0:e.form)??null}updated(e){var o,a,l;super.updated(e),e.has("value")&&((o=this.internals)==null||o.setFormValue(this.value)),e.has("error")&&(this.error?(a=this.internals)==null||a.setValidity({customError:!0},"Invalid input",this.inputElement):(l=this.internals)==null||l.setValidity({}))}checkValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.checkValidity())??!0}reportValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.reportValidity())??!0}setCustomValidity(e){var o;(o=this.inputRef.value)==null||o.setCustomValidity(e)}firstUpdated(){this.autofocus&&this.focus(),s.fromEvent(this.inputElement,"input").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"change").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"keyup").pipe(s.filter(e=>e.key==="Enter"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("enter",{detail:{value:o},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"animationstart").pipe(s.filter(e=>e.animationName==="onAutoFillStart"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0,composed:!0}))})}select(){var e;return(e=this.inputRef.value)==null?void 0:e.select()}getValidity(){var e;return(e=this.inputRef.value)==null?void 0:e.validity}focus(e){var o;(o=this.inputRef.value)==null||o.focus(e),this.dispatchEvent(new Event("focus"))}click(){var e;(e=this.inputRef.value)==null||e.click(),this.dispatchEvent(new Event("click"))}blur(){var e;(e=this.inputRef.value)==null||e.blur(),this.dispatchEvent(new Event("blur"))}render(){const e={"w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]":!0,"outline-secondary-default focus:outline-1 ":!0,"disabled:opacity-40 disabled:cursor-not-allowed":!0,"placeholder:text-muted":!0,"ring-0 ring-inset focus:ring-1 focus:ring-inset":!0,"ring-secondary-default ring-outline focus:ring-secondary-default":!this.error,"ring-error-default focus:ring-error-default":this.error,"caret-transparent focus:outline-hidden cursor-pointer text-select-none":this.readonly,"cursor-pointer":this.clickable,"text-center":this.align==="center","text-right":this.align==="right"},o={"opacity-40":this.disabled,"block mb-[4px]":!0};return c.html`
|
|
2
|
-
${b.when(this.label,()=>c.html`
|
|
3
|
-
<label
|
|
4
|
-
for=${this.id}
|
|
5
|
-
id="label-${this.id}"
|
|
6
|
-
class=${m.classMap(o)}
|
|
7
|
-
${y.color({color:this.error?h.SchmancyTheme.sys.color.error.default:h.SchmancyTheme.sys.color.primary.default})}
|
|
8
|
-
>
|
|
9
|
-
<schmancy-typography type="label" token="lg">${this.label}</schmancy-typography>
|
|
10
|
-
</label>
|
|
11
|
-
`)}
|
|
12
|
-
|
|
13
|
-
<input
|
|
14
|
-
${y.color({bgColor:h.SchmancyTheme.sys.color.surface.highest,color:h.SchmancyTheme.sys.color.surface.on})}
|
|
15
|
-
${f.ref(this.inputRef)}
|
|
16
|
-
id=${this.id}
|
|
17
|
-
name=${this.name}
|
|
18
|
-
class=${m.classMap(e)}
|
|
19
|
-
.value=${this.value}
|
|
20
|
-
.type=${this.type}
|
|
21
|
-
.autocomplete=${this.autocomplete}
|
|
22
|
-
.spellcheck=${this.spellcheck}
|
|
23
|
-
placeholder=${this.placeholder}
|
|
24
|
-
inputmode=${n.ifDefined(this.inputmode)}
|
|
25
|
-
pattern=${n.ifDefined(this.pattern)}
|
|
26
|
-
step=${n.ifDefined(this.step)}
|
|
27
|
-
minlength=${n.ifDefined(this.minlength)}
|
|
28
|
-
maxlength=${n.ifDefined(this.maxlength)}
|
|
29
|
-
min=${n.ifDefined(this.min)}
|
|
30
|
-
max=${n.ifDefined(this.max)}
|
|
31
|
-
?required=${this.required}
|
|
32
|
-
?disabled=${this.disabled}
|
|
33
|
-
?readonly=${this.readonly}
|
|
34
|
-
aria-invalid=${this.error?"true":"false"}
|
|
35
|
-
aria-required=${this.required?"true":"false"}
|
|
36
|
-
aria-labelledby=${this.label?`label-${this.id}`:c.nothing}
|
|
37
|
-
aria-describedby=${this.hint?`hint-${this.id}`:c.nothing}
|
|
38
|
-
aria-label=${n.ifDefined(this.label?void 0:this.placeholder||"Input")}
|
|
39
|
-
/>
|
|
40
|
-
|
|
41
|
-
${b.when(this.hint,()=>c.html`
|
|
42
|
-
<div
|
|
43
|
-
id="hint-${this.id}"
|
|
44
|
-
class="pt-[2px]"
|
|
45
|
-
${y.color({color:this.error?h.SchmancyTheme.sys.color.error.default:h.SchmancyTheme.sys.color.primary.default})}
|
|
46
|
-
>
|
|
47
|
-
<schmancy-typography align="left" type="label"> ${this.hint} </schmancy-typography>
|
|
48
|
-
</div>
|
|
49
|
-
`)}
|
|
50
|
-
`}};t._idCounter=0,t.formAssociated=!0,t.shadowRootOptions={...c.LitElement.shadowRootOptions,delegatesFocus:!0},r([i.property({reflect:!0})],t.prototype,"id",2),r([i.property({type:String})],t.prototype,"label",2),r([i.property({reflect:!0})],t.prototype,"type",2),r([i.property()],t.prototype,"name",2),r([i.property()],t.prototype,"placeholder",2),r([i.property({type:String,reflect:!0})],t.prototype,"value",2),r([i.property({type:String,reflect:!0})],t.prototype,"pattern",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"required",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"readonly",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"clickable",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"spellcheck",2),r([i.property({type:String,reflect:!0})],t.prototype,"align",2),r([i.property()],t.prototype,"inputmode",2),r([i.property({type:Number})],t.prototype,"minlength",2),r([i.property({type:Number})],t.prototype,"maxlength",2),r([i.property()],t.prototype,"min",2),r([i.property()],t.prototype,"max",2),r([i.property({type:Number,reflect:!0})],t.prototype,"step",2),r([i.property({type:Boolean})],t.prototype,"autofocus",2),r([i.property({type:String,reflect:!0})],t.prototype,"autocomplete",2),r([i.property({type:Number,reflect:!0})],t.prototype,"tabIndex",2),r([i.property()],t.prototype,"hint",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"error",2),r([i.query("input")],t.prototype,"inputElement",2),t=r([i.customElement("schmancy-input")],t);
|
|
51
|
-
//# sourceMappingURL=input-CszLZ81k.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-CszLZ81k.cjs","sources":["../src/input/input.ts"],"sourcesContent":["import { html, LitElement, nothing, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { distinctUntilChanged, filter, fromEvent, map, takeUntil } from 'rxjs'\n\nimport { TailwindElement } from '@mixins/index'\n\n// color directive + theme interface\nimport { color } from '@schmancy/directives'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\n\n// If you want to be form-associated, define the type on `ElementInternals`.\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-input': SchmancyInput\n\t}\n}\n\ntype EventDetails = {\n\tvalue: string\n}\n\n/**\n * Custom events the component may emit:\n * - 'input': on every keystroke\n * - 'change': on native blur/change\n * - 'enter': specifically when user presses Enter\n */\nexport type SchmancyInputInputEvent = CustomEvent<EventDetails>\nexport type SchmancyInputChangeEvent = CustomEvent<EventDetails>\nexport type SchmancyInputEnterEvent = CustomEvent<EventDetails>\n\n@customElement('schmancy-input')\nexport default class SchmancyInput extends TailwindElement() {\n\t// ----------------------------\n\t// A) Public properties\n\t// ----------------------------\n\n\t/** If user does NOT set `id`, we'll autogenerate one. */\n\tstatic _idCounter = 0\n\n\t@property({ reflect: true })\n\tpublic override id = ''\n\n\t/**\n\t * The label for the control. If populated, we render a `<label for=\"...\">`.\n\t * If empty, we add an `aria-label` to the <input> for better screenreader support.\n\t */\n\t@property({ type: String }) label = ''\n\n\t/**\n\t * The type of input. (e.g. 'text', 'password', 'email', etc.)\n\t */\n\t@property({ reflect: true })\n\tpublic type: HTMLInputElement['type'] = 'text'\n\n\t/**\n\t * Name attribute (for form submissions). By default, a unique fallback.\n\t */\n\t@property()\n\tpublic name = `name_${Date.now()}`\n\n\t@property()\n\tpublic placeholder = ''\n\n\t/** Current value of the input. */\n\t@property({ type: String, reflect: true })\n\tpublic value = ''\n\n\t/** Pattern validation attribute. */\n\t@property({ type: String, reflect: true })\n\tpublic pattern?: string\n\n\t/** Whether the control is required for form validation. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic required = false\n\n\t/** Whether the control is disabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/** Whether the input is read-only. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic readonly = false\n\n\t/** If true, we visually show a pointer cursor even if readOnly. */\n\t@property({ type: Boolean, reflect: true }) public clickable = false\n\n\t/** Whether browser spellcheck is enabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic spellcheck = false\n\n\t/**\n\t * Text alignment within the input.\n\t * - 'left' | 'center' | 'right'\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic align: 'left' | 'center' | 'right' = 'left'\n\n\t/** inputmode attribute (affects on-screen keyboards in mobile). */\n\t@property()\n\tpublic inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'\n\n\t@property({ type: Number })\n\tpublic minlength?: number\n\n\t@property({ type: Number })\n\tpublic maxlength?: number\n\n\t@property()\n\tpublic min?: string\n\n\t@property()\n\tpublic max?: string\n\n\t@property({ type: Number, reflect: true })\n\tpublic step?: number\n\n\t/** If true, auto-focus this input on first render. */\n\t@property({ type: Boolean })\n\tpublic autofocus = false\n\n\t/** Autocomplete/autofill hints. */\n\t@property({ type: String, reflect: true })\n\tpublic autocomplete: AutoFill = 'on'\n\n\t/**\n\t * tabIndex for focusing by tab key. Typically 0 or -1.\n\t */\n\t@property({ type: Number, reflect: true })\n\tpublic tabIndex = 0\n\n\t/**\n\t * A small hint text or error message to display under the input.\n\t */\n\t@property()\n\tpublic hint?: string\n\n\t/**\n\t * If true, we style the input as an error state, and possibly display\n\t * the hint as an error message.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic error = false\n\n\t// ----------------------------\n\t// B) Queries & Refs\n\t// ----------------------------\n\t@query('input') private inputElement!: HTMLInputElement\n\tprivate inputRef = createRef<HTMLInputElement>()\n\n\t// ----------------------------\n\t// C) Form-associated logic\n\t// ----------------------------\n\tstatic formAssociated = true\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true, // so focus() goes to <input>\n\t}\n\n\tprivate internals?: ElementInternals\n\n\tconstructor() {\n\t\tsuper()\n\t\tif ('attachInternals' in this) {\n\t\t\ttry {\n\t\t\t\tthis.internals = this.attachInternals()\n\t\t\t} catch {\n\t\t\t\t// no-op for older browsers / polyfills\n\t\t\t\tthis.internals = undefined\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If user did not provide an ID, auto-generate one so <label for=\"...\">\n\t * and various aria-* attributes can reference it.\n\t */\n\tprotected override willUpdate(changedProps: PropertyValueMap<any> | Map<PropertyKey, unknown>) {\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-input-${SchmancyInput._idCounter++}`\n\t\t}\n\t\tsuper.willUpdate(changedProps)\n\t}\n\n\t/** The form this element is associated with, if any. */\n\tget form() {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tprotected override updated(changedProps: Map<string, unknown>) {\n\t\tsuper.updated(changedProps)\n\t\tif (changedProps.has('value')) {\n\t\t\t// Reflect the current value to the form internals, so it’s submitted.\n\t\t\tthis.internals?.setFormValue(this.value)\n\t\t}\n\n\t\tif (changedProps.has('error')) {\n\t\t\t// If we have an error state, we can set custom error validity, or none if resolved.\n\t\t\tif (this.error) {\n\t\t\t\tthis.internals?.setValidity({ customError: true }, 'Invalid input', this.inputElement)\n\t\t\t} else {\n\t\t\t\tthis.internals?.setValidity({})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Native form methods:\n\t * - checkValidity()\n\t * - reportValidity()\n\t * - setCustomValidity()\n\t */\n\tpublic checkValidity() {\n\t\treturn this.inputRef.value?.checkValidity() ?? true\n\t}\n\tpublic reportValidity() {\n\t\treturn this.inputRef.value?.reportValidity() ?? true\n\t}\n\tpublic setCustomValidity(message: string) {\n\t\tthis.inputRef.value?.setCustomValidity(message)\n\t}\n\n\t// ----------------------------\n\t// D) Lifecycle Hooks\n\t// ----------------------------\n\tfirstUpdated() {\n\t\t// Autofocus if desired\n\t\tif (this.autofocus) {\n\t\t\tthis.focus()\n\t\t}\n\n\t\t// 1) Subscribe to 'input' events (every keystroke)\n\t\tfromEvent<InputEvent>(this.inputElement, 'input')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\t// Fire custom 'input' event with details\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('input', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t// dispatch change event\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 2) Subscribe to 'change' events (native behavior, usually on blur)\n\t\tfromEvent<Event>(this.inputElement, 'change')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 3) Emit a custom 'enter' event when user presses Enter\n\t\tfromEvent<KeyboardEvent>(this.inputElement, 'keyup')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.key === 'Enter'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('enter', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 4) Detect autofill animation (Chrome, etc.)\n\t\tfromEvent<AnimationEvent>(this.inputElement, 'animationstart')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.animationName === 'onAutoFillStart'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\n\t// ----------------------------\n\t// E) Utility Methods\n\t// ----------------------------\n\t/** Selects all text within the input. */\n\tpublic select() {\n\t\treturn this.inputRef.value?.select()\n\t}\n\n\t/** Returns the native validity state of the inner <input>. */\n\tpublic getValidity(): ValidityState | undefined {\n\t\treturn this.inputRef.value?.validity\n\t}\n\n\t/**\n\t * Override to forward focus to the internal <input>.\n\t * Also dispatch a 'focus' event for external listeners.\n\t */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.inputRef.value?.focus(options)\n\t\tthis.dispatchEvent(new Event('focus'))\n\t}\n\n\t/**\n\t * Override to forward clicks to the internal <input>.\n\t * Also dispatch a 'click' event for external listeners.\n\t */\n\tpublic override click() {\n\t\tthis.inputRef.value?.click()\n\t\tthis.dispatchEvent(new Event('click'))\n\t}\n\n\t/** Forward blur to the internal <input>. */\n\tpublic override blur() {\n\t\tthis.inputRef.value?.blur()\n\t\tthis.dispatchEvent(new Event('blur'))\n\t}\n\n\t// ----------------------------\n\t// F) Rendering\n\t// ----------------------------\n\tprotected override render() {\n\t\tconst inputClasses = {\n\t\t\t'w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]': true,\n\t\t\t'outline-secondary-default focus:outline-1 ': true,\n\t\t\t'disabled:opacity-40 disabled:cursor-not-allowed': true,\n\t\t\t'placeholder:text-muted': true,\n\t\t\t'ring-0 ring-inset focus:ring-1 focus:ring-inset': true,\n\t\t\t// If not in error state, use standard ring color:\n\t\t\t'ring-secondary-default ring-outline focus:ring-secondary-default': !this.error,\n\t\t\t// Error ring override:\n\t\t\t'ring-error-default focus:ring-error-default': this.error,\n\t\t\t// If read-only but \"clickable\" is true, show pointer. Otherwise normal text cursor.\n\t\t\t'caret-transparent focus:outline-hidden cursor-pointer text-select-none': this.readonly,\n\t\t\t'cursor-pointer': this.clickable,\n\t\t\t// Alignment classes:\n\t\t\t'text-center': this.align === 'center',\n\t\t\t'text-right': this.align === 'right',\n\t\t}\n\n\t\tconst labelClasses = {\n\t\t\t'opacity-40': this.disabled,\n\t\t\t'block mb-[4px]': true,\n\t\t}\n\n\t\t/**\n\t\t * - If `this.label` is present, we render a proper `<label for=\"${this.id}\">`.\n\t\t * - If not, we add an aria-label to the <input> for better accessibility.\n\t\t * - If there's a `hint`, we reference it via aria-describedby.\n\t\t * - If there's an error, we set aria-invalid and could set aria-errormessage.\n\t\t */\n\t\treturn html`\n\t\t\t${when(\n\t\t\t\tthis.label,\n\t\t\t\t() => html`\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=${this.id}\n\t\t\t\t\t\tid=\"label-${this.id}\"\n\t\t\t\t\t\tclass=${classMap(labelClasses)}\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"lg\">${this.label}</schmancy-typography>\n\t\t\t\t\t</label>\n\t\t\t\t`,\n\t\t\t)}\n\n\t\t\t<input\n\t\t\t\t${color({\n\t\t\t\t\tbgColor: SchmancyTheme.sys.color.surface.highest,\n\t\t\t\t\tcolor: SchmancyTheme.sys.color.surface.on,\n\t\t\t\t})}\n\t\t\t\t${ref(this.inputRef)}\n\t\t\t\tid=${this.id}\n\t\t\t\tname=${this.name}\n\t\t\t\tclass=${classMap(inputClasses)}\n\t\t\t\t.value=${this.value}\n\t\t\t\t.type=${this.type}\n\t\t\t\t.autocomplete=${this.autocomplete}\n\t\t\t\t.spellcheck=${this.spellcheck}\n\t\t\t\tplaceholder=${this.placeholder}\n\t\t\t\tinputmode=${ifDefined(this.inputmode)}\n\t\t\t\tpattern=${ifDefined(this.pattern)}\n\t\t\t\tstep=${ifDefined(this.step)}\n\t\t\t\tminlength=${ifDefined(this.minlength)}\n\t\t\t\tmaxlength=${ifDefined(this.maxlength)}\n\t\t\t\tmin=${ifDefined(this.min)}\n\t\t\t\tmax=${ifDefined(this.max)}\n\t\t\t\t?required=${this.required}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t?readonly=${this.readonly}\n\t\t\t\taria-invalid=${this.error ? 'true' : 'false'}\n\t\t\t\taria-required=${this.required ? 'true' : 'false'}\n\t\t\t\taria-labelledby=${this.label ? `label-${this.id}` : nothing}\n\t\t\t\taria-describedby=${this.hint ? `hint-${this.id}` : nothing}\n\t\t\t\taria-label=${ifDefined(!this.label ? this.placeholder || 'Input' : undefined)}\n\t\t\t/>\n\n\t\t\t${when(\n\t\t\t\tthis.hint,\n\t\t\t\t() => html`\n\t\t\t\t\t<div\n\t\t\t\t\t\tid=\"hint-${this.id}\"\n\t\t\t\t\t\tclass=\"pt-[2px]\"\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography align=\"left\" type=\"label\"> ${this.hint} </schmancy-typography>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t)}\n\t\t`\n\t}\n}\n"],"names":["SchmancyInput","TailwindElement","super","this","id","label","type","name","Date","now","placeholder","value","required","disabled","readonly","clickable","spellcheck","align","autofocus","autocomplete","tabIndex","error","inputRef","createRef","internals","attachInternals","changedProps","_idCounter","willUpdate","form","updated","has","setFormValue","setValidity","customError","inputElement","checkValidity","reportValidity","message","setCustomValidity","focus","fromEvent","pipe","map","ev","target","distinctUntilChanged","takeUntil","disconnecting","subscribe","dispatchEvent","CustomEvent","detail","bubbles","composed","filter","key","animationName","select","validity","options","Event","click","blur","render","inputClasses","labelClasses","html","when","classMap","color","SchmancyTheme","sys","default","primary","bgColor","surface","highest","on","ref","ifDefined","inputmode","pattern","step","minlength","maxlength","min","max","nothing","hint","formAssociated","shadowRootOptions","LitElement","delegatesFocus","__decorateClass","property","reflect","prototype","String","Boolean","Number","query","customElement"],"mappings":"slBAoCA,IAAqBA,EAArB,cAA2CC,EAAAA,gBAiI1C,CAAA,CAAA,aAEC,CAAA,GADMC,MAzHPC,EAAAA,KAAgBC,GAAK,GAMeD,KAAAE,MAAA,GAMpCF,KAAOG,KAAiC,OAMxCH,KAAOI,KAAO,QAAQC,KAAKC,IAG3BN,CAAAA,GAAAA,KAAOO,YAAc,GAIrBP,KAAOQ,MAAQ,GAQfR,KAAOS,SAAW,GAIlBT,KAAOU,SAAAA,GAIPV,KAAOW,SAAW,GAG0BX,KAAOY,UAAY,GAI/DZ,KAAOa,WAAAA,GAOPb,KAAOc,MAAqC,OAuB5Cd,KAAOe,UAAAA,GAIPf,KAAOgB,aAAyB,KAMhChB,KAAOiB,SAAW,EAalBjB,KAAOkB,MAAQ,GAMflB,KAAQmB,SAAWC,cAed,oBAAqBpB,KACpB,GACEA,CAAAA,KAAAqB,UAAYrB,KAAKsB,gBAAgB,CAAA,MAGtCtB,CAAAA,KAAKqB,UAAY,MAAA,CAEnB,CAOkB,WAAWE,EACxBvB,CAAAA,KAAKC,KACJD,KAAAC,GAAK,kBAAkBJ,EAAc2B,cAE3CzB,MAAM0B,WAAWF,CAAY,CAAA,CAI9B,IAAIG,MAAAA,OACI,QAAA1B,EAAAA,KAAKqB,YAALrB,YAAAA,EAAgB0B,OAAQ,IAAA,CAGb,QAAQH,EAC1BxB,WAAAA,MAAM4B,QAAQJ,CACVA,EAAAA,EAAaK,IAAI,OAAA,KAEf5B,EAAAA,KAAAqB,YAAArB,MAAAA,EAAW6B,aAAa7B,KAAKQ,QAG/Be,EAAaK,IAAI,OAAA,IAEhB5B,KAAKkB,OACHlB,EAAAA,KAAAqB,YAAArB,MAAAA,EAAW8B,YAAY,CAAEC,YAAa,EAAA,EAAQ,gBAAiB/B,KAAKgC,eAEpEhC,EAAAA,KAAAqB,YAAArB,MAAAA,EAAW8B,YAAY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BMF.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { nothing as f, html as y, LitElement as x } from "lit";
|
|
2
|
-
import { property as s, query as w, customElement as k } from "lit/decorators.js";
|
|
3
|
-
import { classMap as b } from "lit/directives/class-map.js";
|
|
4
|
-
import { ifDefined as o } from "lit/directives/if-defined.js";
|
|
5
|
-
import { createRef as R, ref as C } from "lit/directives/ref.js";
|
|
6
|
-
import { when as v } from "lit/directives/when.js";
|
|
7
|
-
import { fromEvent as h, map as g, distinctUntilChanged as $, takeUntil as c, filter as E } from "rxjs";
|
|
8
|
-
import "lit/directives/style-map.js";
|
|
9
|
-
import { T as V } from "./tailwind.mixin-DklgfhB4.js";
|
|
10
|
-
import { c as m } from "./ripple-BumgqsDT.js";
|
|
11
|
-
import { S as p } from "./theme.interface-C5Kj6WjD.js";
|
|
12
|
-
var q = Object.defineProperty, B = Object.getOwnPropertyDescriptor, i = (t, r, n, a) => {
|
|
13
|
-
for (var u, l = a > 1 ? void 0 : a ? B(r, n) : r, d = t.length - 1; d >= 0; d--) (u = t[d]) && (l = (a ? u(r, n, l) : u(l)) || l);
|
|
14
|
-
return a && l && q(r, n, l), l;
|
|
15
|
-
};
|
|
16
|
-
let e = class extends V() {
|
|
17
|
-
constructor() {
|
|
18
|
-
if (super(), this.id = "", this.label = "", this.type = "text", this.name = `name_${Date.now()}`, this.placeholder = "", this.value = "", this.required = !1, this.disabled = !1, this.readonly = !1, this.clickable = !1, this.spellcheck = !1, this.align = "left", this.autofocus = !1, this.autocomplete = "on", this.tabIndex = 0, this.error = !1, this.inputRef = R(), "attachInternals" in this) try {
|
|
19
|
-
this.internals = this.attachInternals();
|
|
20
|
-
} catch {
|
|
21
|
-
this.internals = void 0;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
willUpdate(t) {
|
|
25
|
-
this.id || (this.id = "schmancy-input-" + e._idCounter++), super.willUpdate(t);
|
|
26
|
-
}
|
|
27
|
-
get form() {
|
|
28
|
-
var t;
|
|
29
|
-
return ((t = this.internals) == null ? void 0 : t.form) ?? null;
|
|
30
|
-
}
|
|
31
|
-
updated(t) {
|
|
32
|
-
var r, n, a;
|
|
33
|
-
super.updated(t), t.has("value") && ((r = this.internals) == null || r.setFormValue(this.value)), t.has("error") && (this.error ? (n = this.internals) == null || n.setValidity({ customError: !0 }, "Invalid input", this.inputElement) : (a = this.internals) == null || a.setValidity({}));
|
|
34
|
-
}
|
|
35
|
-
checkValidity() {
|
|
36
|
-
var t;
|
|
37
|
-
return ((t = this.inputRef.value) == null ? void 0 : t.checkValidity()) ?? !0;
|
|
38
|
-
}
|
|
39
|
-
reportValidity() {
|
|
40
|
-
var t;
|
|
41
|
-
return ((t = this.inputRef.value) == null ? void 0 : t.reportValidity()) ?? !0;
|
|
42
|
-
}
|
|
43
|
-
setCustomValidity(t) {
|
|
44
|
-
var r;
|
|
45
|
-
(r = this.inputRef.value) == null || r.setCustomValidity(t);
|
|
46
|
-
}
|
|
47
|
-
firstUpdated() {
|
|
48
|
-
this.autofocus && this.focus(), h(this.inputElement, "input").pipe(g((t) => t.target.value), $(), c(this.disconnecting)).subscribe((t) => {
|
|
49
|
-
this.value = t, this.dispatchEvent(new CustomEvent("input", { detail: { value: t }, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: { value: t }, bubbles: !0, composed: !0 }));
|
|
50
|
-
}), h(this.inputElement, "change").pipe(g((t) => t.target.value), $(), c(this.disconnecting)).subscribe((t) => {
|
|
51
|
-
this.value = t, this.dispatchEvent(new CustomEvent("change", { detail: { value: t }, bubbles: !0, composed: !0 }));
|
|
52
|
-
}), h(this.inputElement, "keyup").pipe(E((t) => t.key === "Enter"), c(this.disconnecting)).subscribe((t) => {
|
|
53
|
-
const { value: r } = t.target;
|
|
54
|
-
this.value = r, this.dispatchEvent(new CustomEvent("enter", { detail: { value: r }, bubbles: !0, composed: !0 }));
|
|
55
|
-
}), h(this.inputElement, "animationstart").pipe(E((t) => t.animationName === "onAutoFillStart"), c(this.disconnecting)).subscribe((t) => {
|
|
56
|
-
const { value: r } = t.target;
|
|
57
|
-
this.value = r, this.dispatchEvent(new CustomEvent("change", { detail: { value: r }, bubbles: !0, composed: !0 }));
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
select() {
|
|
61
|
-
var t;
|
|
62
|
-
return (t = this.inputRef.value) == null ? void 0 : t.select();
|
|
63
|
-
}
|
|
64
|
-
getValidity() {
|
|
65
|
-
var t;
|
|
66
|
-
return (t = this.inputRef.value) == null ? void 0 : t.validity;
|
|
67
|
-
}
|
|
68
|
-
focus(t) {
|
|
69
|
-
var r;
|
|
70
|
-
(r = this.inputRef.value) == null || r.focus(t), this.dispatchEvent(new Event("focus"));
|
|
71
|
-
}
|
|
72
|
-
click() {
|
|
73
|
-
var t;
|
|
74
|
-
(t = this.inputRef.value) == null || t.click(), this.dispatchEvent(new Event("click"));
|
|
75
|
-
}
|
|
76
|
-
blur() {
|
|
77
|
-
var t;
|
|
78
|
-
(t = this.inputRef.value) == null || t.blur(), this.dispatchEvent(new Event("blur"));
|
|
79
|
-
}
|
|
80
|
-
render() {
|
|
81
|
-
const t = { "w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]": !0, "outline-secondary-default focus:outline-1 ": !0, "disabled:opacity-40 disabled:cursor-not-allowed": !0, "placeholder:text-muted": !0, "ring-0 ring-inset focus:ring-1 focus:ring-inset": !0, "ring-secondary-default ring-outline focus:ring-secondary-default": !this.error, "ring-error-default focus:ring-error-default": this.error, "caret-transparent focus:outline-hidden cursor-pointer text-select-none": this.readonly, "cursor-pointer": this.clickable, "text-center": this.align === "center", "text-right": this.align === "right" }, r = { "opacity-40": this.disabled, "block mb-[4px]": !0 };
|
|
82
|
-
return y`
|
|
83
|
-
${v(this.label, () => y`
|
|
84
|
-
<label
|
|
85
|
-
for=${this.id}
|
|
86
|
-
id="label-${this.id}"
|
|
87
|
-
class=${b(r)}
|
|
88
|
-
${m({ color: this.error ? p.sys.color.error.default : p.sys.color.primary.default })}
|
|
89
|
-
>
|
|
90
|
-
<schmancy-typography type="label" token="lg">${this.label}</schmancy-typography>
|
|
91
|
-
</label>
|
|
92
|
-
`)}
|
|
93
|
-
|
|
94
|
-
<input
|
|
95
|
-
${m({ bgColor: p.sys.color.surface.highest, color: p.sys.color.surface.on })}
|
|
96
|
-
${C(this.inputRef)}
|
|
97
|
-
id=${this.id}
|
|
98
|
-
name=${this.name}
|
|
99
|
-
class=${b(t)}
|
|
100
|
-
.value=${this.value}
|
|
101
|
-
.type=${this.type}
|
|
102
|
-
.autocomplete=${this.autocomplete}
|
|
103
|
-
.spellcheck=${this.spellcheck}
|
|
104
|
-
placeholder=${this.placeholder}
|
|
105
|
-
inputmode=${o(this.inputmode)}
|
|
106
|
-
pattern=${o(this.pattern)}
|
|
107
|
-
step=${o(this.step)}
|
|
108
|
-
minlength=${o(this.minlength)}
|
|
109
|
-
maxlength=${o(this.maxlength)}
|
|
110
|
-
min=${o(this.min)}
|
|
111
|
-
max=${o(this.max)}
|
|
112
|
-
?required=${this.required}
|
|
113
|
-
?disabled=${this.disabled}
|
|
114
|
-
?readonly=${this.readonly}
|
|
115
|
-
aria-invalid=${this.error ? "true" : "false"}
|
|
116
|
-
aria-required=${this.required ? "true" : "false"}
|
|
117
|
-
aria-labelledby=${this.label ? `label-${this.id}` : f}
|
|
118
|
-
aria-describedby=${this.hint ? `hint-${this.id}` : f}
|
|
119
|
-
aria-label=${o(this.label ? void 0 : this.placeholder || "Input")}
|
|
120
|
-
/>
|
|
121
|
-
|
|
122
|
-
${v(this.hint, () => y`
|
|
123
|
-
<div
|
|
124
|
-
id="hint-${this.id}"
|
|
125
|
-
class="pt-[2px]"
|
|
126
|
-
${m({ color: this.error ? p.sys.color.error.default : p.sys.color.primary.default })}
|
|
127
|
-
>
|
|
128
|
-
<schmancy-typography align="left" type="label"> ${this.hint} </schmancy-typography>
|
|
129
|
-
</div>
|
|
130
|
-
`)}
|
|
131
|
-
`;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
e._idCounter = 0, e.formAssociated = !0, e.shadowRootOptions = { ...x.shadowRootOptions, delegatesFocus: !0 }, i([s({ reflect: !0 })], e.prototype, "id", 2), i([s({ type: String })], e.prototype, "label", 2), i([s({ reflect: !0 })], e.prototype, "type", 2), i([s()], e.prototype, "name", 2), i([s()], e.prototype, "placeholder", 2), i([s({ type: String, reflect: !0 })], e.prototype, "value", 2), i([s({ type: String, reflect: !0 })], e.prototype, "pattern", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "required", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "disabled", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "readonly", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "clickable", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "spellcheck", 2), i([s({ type: String, reflect: !0 })], e.prototype, "align", 2), i([s()], e.prototype, "inputmode", 2), i([s({ type: Number })], e.prototype, "minlength", 2), i([s({ type: Number })], e.prototype, "maxlength", 2), i([s()], e.prototype, "min", 2), i([s()], e.prototype, "max", 2), i([s({ type: Number, reflect: !0 })], e.prototype, "step", 2), i([s({ type: Boolean })], e.prototype, "autofocus", 2), i([s({ type: String, reflect: !0 })], e.prototype, "autocomplete", 2), i([s({ type: Number, reflect: !0 })], e.prototype, "tabIndex", 2), i([s()], e.prototype, "hint", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "error", 2), i([w("input")], e.prototype, "inputElement", 2), e = i([k("schmancy-input")], e);
|
|
135
|
-
//# sourceMappingURL=input-CwWLOBMF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-CwWLOBMF.js","sources":["../src/input/input.ts"],"sourcesContent":["import { html, LitElement, nothing, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { distinctUntilChanged, filter, fromEvent, map, takeUntil } from 'rxjs'\n\nimport { TailwindElement } from '@mixins/index'\n\n// color directive + theme interface\nimport { color } from '@schmancy/directives'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\n\n// If you want to be form-associated, define the type on `ElementInternals`.\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-input': SchmancyInput\n\t}\n}\n\ntype EventDetails = {\n\tvalue: string\n}\n\n/**\n * Custom events the component may emit:\n * - 'input': on every keystroke\n * - 'change': on native blur/change\n * - 'enter': specifically when user presses Enter\n */\nexport type SchmancyInputInputEvent = CustomEvent<EventDetails>\nexport type SchmancyInputChangeEvent = CustomEvent<EventDetails>\nexport type SchmancyInputEnterEvent = CustomEvent<EventDetails>\n\n@customElement('schmancy-input')\nexport default class SchmancyInput extends TailwindElement() {\n\t// ----------------------------\n\t// A) Public properties\n\t// ----------------------------\n\n\t/** If user does NOT set `id`, we'll autogenerate one. */\n\tstatic _idCounter = 0\n\n\t@property({ reflect: true })\n\tpublic override id = ''\n\n\t/**\n\t * The label for the control. If populated, we render a `<label for=\"...\">`.\n\t * If empty, we add an `aria-label` to the <input> for better screenreader support.\n\t */\n\t@property({ type: String }) label = ''\n\n\t/**\n\t * The type of input. (e.g. 'text', 'password', 'email', etc.)\n\t */\n\t@property({ reflect: true })\n\tpublic type: HTMLInputElement['type'] = 'text'\n\n\t/**\n\t * Name attribute (for form submissions). By default, a unique fallback.\n\t */\n\t@property()\n\tpublic name = `name_${Date.now()}`\n\n\t@property()\n\tpublic placeholder = ''\n\n\t/** Current value of the input. */\n\t@property({ type: String, reflect: true })\n\tpublic value = ''\n\n\t/** Pattern validation attribute. */\n\t@property({ type: String, reflect: true })\n\tpublic pattern?: string\n\n\t/** Whether the control is required for form validation. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic required = false\n\n\t/** Whether the control is disabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/** Whether the input is read-only. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic readonly = false\n\n\t/** If true, we visually show a pointer cursor even if readOnly. */\n\t@property({ type: Boolean, reflect: true }) public clickable = false\n\n\t/** Whether browser spellcheck is enabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic spellcheck = false\n\n\t/**\n\t * Text alignment within the input.\n\t * - 'left' | 'center' | 'right'\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic align: 'left' | 'center' | 'right' = 'left'\n\n\t/** inputmode attribute (affects on-screen keyboards in mobile). */\n\t@property()\n\tpublic inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'\n\n\t@property({ type: Number })\n\tpublic minlength?: number\n\n\t@property({ type: Number })\n\tpublic maxlength?: number\n\n\t@property()\n\tpublic min?: string\n\n\t@property()\n\tpublic max?: string\n\n\t@property({ type: Number, reflect: true })\n\tpublic step?: number\n\n\t/** If true, auto-focus this input on first render. */\n\t@property({ type: Boolean })\n\tpublic autofocus = false\n\n\t/** Autocomplete/autofill hints. */\n\t@property({ type: String, reflect: true })\n\tpublic autocomplete: AutoFill = 'on'\n\n\t/**\n\t * tabIndex for focusing by tab key. Typically 0 or -1.\n\t */\n\t@property({ type: Number, reflect: true })\n\tpublic tabIndex = 0\n\n\t/**\n\t * A small hint text or error message to display under the input.\n\t */\n\t@property()\n\tpublic hint?: string\n\n\t/**\n\t * If true, we style the input as an error state, and possibly display\n\t * the hint as an error message.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic error = false\n\n\t// ----------------------------\n\t// B) Queries & Refs\n\t// ----------------------------\n\t@query('input') private inputElement!: HTMLInputElement\n\tprivate inputRef = createRef<HTMLInputElement>()\n\n\t// ----------------------------\n\t// C) Form-associated logic\n\t// ----------------------------\n\tstatic formAssociated = true\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true, // so focus() goes to <input>\n\t}\n\n\tprivate internals?: ElementInternals\n\n\tconstructor() {\n\t\tsuper()\n\t\tif ('attachInternals' in this) {\n\t\t\ttry {\n\t\t\t\tthis.internals = this.attachInternals()\n\t\t\t} catch {\n\t\t\t\t// no-op for older browsers / polyfills\n\t\t\t\tthis.internals = undefined\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If user did not provide an ID, auto-generate one so <label for=\"...\">\n\t * and various aria-* attributes can reference it.\n\t */\n\tprotected override willUpdate(changedProps: PropertyValueMap<any> | Map<PropertyKey, unknown>) {\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-input-${SchmancyInput._idCounter++}`\n\t\t}\n\t\tsuper.willUpdate(changedProps)\n\t}\n\n\t/** The form this element is associated with, if any. */\n\tget form() {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tprotected override updated(changedProps: Map<string, unknown>) {\n\t\tsuper.updated(changedProps)\n\t\tif (changedProps.has('value')) {\n\t\t\t// Reflect the current value to the form internals, so it’s submitted.\n\t\t\tthis.internals?.setFormValue(this.value)\n\t\t}\n\n\t\tif (changedProps.has('error')) {\n\t\t\t// If we have an error state, we can set custom error validity, or none if resolved.\n\t\t\tif (this.error) {\n\t\t\t\tthis.internals?.setValidity({ customError: true }, 'Invalid input', this.inputElement)\n\t\t\t} else {\n\t\t\t\tthis.internals?.setValidity({})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Native form methods:\n\t * - checkValidity()\n\t * - reportValidity()\n\t * - setCustomValidity()\n\t */\n\tpublic checkValidity() {\n\t\treturn this.inputRef.value?.checkValidity() ?? true\n\t}\n\tpublic reportValidity() {\n\t\treturn this.inputRef.value?.reportValidity() ?? true\n\t}\n\tpublic setCustomValidity(message: string) {\n\t\tthis.inputRef.value?.setCustomValidity(message)\n\t}\n\n\t// ----------------------------\n\t// D) Lifecycle Hooks\n\t// ----------------------------\n\tfirstUpdated() {\n\t\t// Autofocus if desired\n\t\tif (this.autofocus) {\n\t\t\tthis.focus()\n\t\t}\n\n\t\t// 1) Subscribe to 'input' events (every keystroke)\n\t\tfromEvent<InputEvent>(this.inputElement, 'input')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\t// Fire custom 'input' event with details\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('input', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t// dispatch change event\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 2) Subscribe to 'change' events (native behavior, usually on blur)\n\t\tfromEvent<Event>(this.inputElement, 'change')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 3) Emit a custom 'enter' event when user presses Enter\n\t\tfromEvent<KeyboardEvent>(this.inputElement, 'keyup')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.key === 'Enter'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('enter', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 4) Detect autofill animation (Chrome, etc.)\n\t\tfromEvent<AnimationEvent>(this.inputElement, 'animationstart')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.animationName === 'onAutoFillStart'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\n\t// ----------------------------\n\t// E) Utility Methods\n\t// ----------------------------\n\t/** Selects all text within the input. */\n\tpublic select() {\n\t\treturn this.inputRef.value?.select()\n\t}\n\n\t/** Returns the native validity state of the inner <input>. */\n\tpublic getValidity(): ValidityState | undefined {\n\t\treturn this.inputRef.value?.validity\n\t}\n\n\t/**\n\t * Override to forward focus to the internal <input>.\n\t * Also dispatch a 'focus' event for external listeners.\n\t */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.inputRef.value?.focus(options)\n\t\tthis.dispatchEvent(new Event('focus'))\n\t}\n\n\t/**\n\t * Override to forward clicks to the internal <input>.\n\t * Also dispatch a 'click' event for external listeners.\n\t */\n\tpublic override click() {\n\t\tthis.inputRef.value?.click()\n\t\tthis.dispatchEvent(new Event('click'))\n\t}\n\n\t/** Forward blur to the internal <input>. */\n\tpublic override blur() {\n\t\tthis.inputRef.value?.blur()\n\t\tthis.dispatchEvent(new Event('blur'))\n\t}\n\n\t// ----------------------------\n\t// F) Rendering\n\t// ----------------------------\n\tprotected override render() {\n\t\tconst inputClasses = {\n\t\t\t'w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]': true,\n\t\t\t'outline-secondary-default focus:outline-1 ': true,\n\t\t\t'disabled:opacity-40 disabled:cursor-not-allowed': true,\n\t\t\t'placeholder:text-muted': true,\n\t\t\t'ring-0 ring-inset focus:ring-1 focus:ring-inset': true,\n\t\t\t// If not in error state, use standard ring color:\n\t\t\t'ring-secondary-default ring-outline focus:ring-secondary-default': !this.error,\n\t\t\t// Error ring override:\n\t\t\t'ring-error-default focus:ring-error-default': this.error,\n\t\t\t// If read-only but \"clickable\" is true, show pointer. Otherwise normal text cursor.\n\t\t\t'caret-transparent focus:outline-hidden cursor-pointer text-select-none': this.readonly,\n\t\t\t'cursor-pointer': this.clickable,\n\t\t\t// Alignment classes:\n\t\t\t'text-center': this.align === 'center',\n\t\t\t'text-right': this.align === 'right',\n\t\t}\n\n\t\tconst labelClasses = {\n\t\t\t'opacity-40': this.disabled,\n\t\t\t'block mb-[4px]': true,\n\t\t}\n\n\t\t/**\n\t\t * - If `this.label` is present, we render a proper `<label for=\"${this.id}\">`.\n\t\t * - If not, we add an aria-label to the <input> for better accessibility.\n\t\t * - If there's a `hint`, we reference it via aria-describedby.\n\t\t * - If there's an error, we set aria-invalid and could set aria-errormessage.\n\t\t */\n\t\treturn html`\n\t\t\t${when(\n\t\t\t\tthis.label,\n\t\t\t\t() => html`\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=${this.id}\n\t\t\t\t\t\tid=\"label-${this.id}\"\n\t\t\t\t\t\tclass=${classMap(labelClasses)}\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"lg\">${this.label}</schmancy-typography>\n\t\t\t\t\t</label>\n\t\t\t\t`,\n\t\t\t)}\n\n\t\t\t<input\n\t\t\t\t${color({\n\t\t\t\t\tbgColor: SchmancyTheme.sys.color.surface.highest,\n\t\t\t\t\tcolor: SchmancyTheme.sys.color.surface.on,\n\t\t\t\t})}\n\t\t\t\t${ref(this.inputRef)}\n\t\t\t\tid=${this.id}\n\t\t\t\tname=${this.name}\n\t\t\t\tclass=${classMap(inputClasses)}\n\t\t\t\t.value=${this.value}\n\t\t\t\t.type=${this.type}\n\t\t\t\t.autocomplete=${this.autocomplete}\n\t\t\t\t.spellcheck=${this.spellcheck}\n\t\t\t\tplaceholder=${this.placeholder}\n\t\t\t\tinputmode=${ifDefined(this.inputmode)}\n\t\t\t\tpattern=${ifDefined(this.pattern)}\n\t\t\t\tstep=${ifDefined(this.step)}\n\t\t\t\tminlength=${ifDefined(this.minlength)}\n\t\t\t\tmaxlength=${ifDefined(this.maxlength)}\n\t\t\t\tmin=${ifDefined(this.min)}\n\t\t\t\tmax=${ifDefined(this.max)}\n\t\t\t\t?required=${this.required}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t?readonly=${this.readonly}\n\t\t\t\taria-invalid=${this.error ? 'true' : 'false'}\n\t\t\t\taria-required=${this.required ? 'true' : 'false'}\n\t\t\t\taria-labelledby=${this.label ? `label-${this.id}` : nothing}\n\t\t\t\taria-describedby=${this.hint ? `hint-${this.id}` : nothing}\n\t\t\t\taria-label=${ifDefined(!this.label ? this.placeholder || 'Input' : undefined)}\n\t\t\t/>\n\n\t\t\t${when(\n\t\t\t\tthis.hint,\n\t\t\t\t() => html`\n\t\t\t\t\t<div\n\t\t\t\t\t\tid=\"hint-${this.id}\"\n\t\t\t\t\t\tclass=\"pt-[2px]\"\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography align=\"left\" type=\"label\"> ${this.hint} </schmancy-typography>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t)}\n\t\t`\n\t}\n}\n"],"names":["SchmancyInput","TailwindElement","super","this","id","label","type","name","Date","now","placeholder","value","required","disabled","readonly","clickable","spellcheck","align","autofocus","autocomplete","tabIndex","error","inputRef","createRef","internals","attachInternals","changedProps","_idCounter","willUpdate","form","updated","has","setFormValue","setValidity","customError","inputElement","checkValidity","reportValidity","message","setCustomValidity","firstUpdated","focus","fromEvent","pipe","map","ev","target","distinctUntilChanged","takeUntil","disconnecting","subscribe","dispatchEvent","CustomEvent","detail","bubbles","composed","filter","key","animationName","select","getValidity","validity","options","Event","click","blur","inputClasses","labelClasses","html","when","classMap","color","SchmancyTheme","sys","default","primary","bgColor","surface","highest","on","ref","ifDefined","inputmode","pattern","step","minlength","maxlength","min","max","nothing","hint","formAssociated","shadowRootOptions","LitElement","delegatesFocus","__decorateClass","property","reflect","prototype","String","Boolean","Number","query","customElement"],"mappings":";;;;;;;;;;;;;;;AAoCA,IAAqBA,IAArB,cAA2CC,EAiI1C,EAAA;AAAA,EAAA,cAEC;AAAA,QADMC,MAzHPC,GAAAA,KAAgBC,KAAK,IAMeD,KAAAE,QAAA,IAMpCF,KAAOG,OAAiC,QAMxCH,KAAOI,OAAO,QAAQC,KAAKC,IAG3BN,CAAAA,IAAAA,KAAOO,cAAc,IAIrBP,KAAOQ,QAAQ,IAQfR,KAAOS,WAAW,IAIlBT,KAAOU,WAAAA,IAIPV,KAAOW,WAAW,IAG0BX,KAAOY,YAAAA,IAInDZ,KAAOa,iBAOPb,KAAOc,QAAqC,QAuB5Cd,KAAOe,YAAAA,IAIPf,KAAOgB,eAAyB,MAMhChB,KAAOiB,WAAW,GAalBjB,KAAOkB,QAAQ,IAMflB,KAAQmB,WAAWC,EAed,GAAA,q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AAAA,CAAAA,GAtFEpG,EAuFbkG,WAAA,aAAA,CAAA,GAIAH,EAAA,CADNC,EAAS,EAAE1F,MAAM6F,QAAQF,SAAAA,GA1FNjG,CAAAA,CAAAA,GAAAA,EA2FbkG,WAAA,gBAAA,CAMAH,GAAAA,EAAA,CADNC,EAAS,EAAE1F,MAAM+F,QAAQJ,SAAAA,QAhGNjG,EAiGbkG,WAAA,YAAA,CAAA,GAMAH,EAAA,CADNC,EAtGmBhG,CAAAA,GAAAA,EAuGbkG,WAAA,QAAA,CAOAH,GAAAA,EAAA,CADNC,EAAS,EAAE1F,MAAM8F,SAASH,SAAS,GAAA,CAAA,CAAA,GA7GhBjG,EA8GbkG,WAAA,SAAA,CAAA,GAKiBH,EAAA,CAAvBO,EAAM,OAnHatG,CAAAA,GAAAA,EAmHIkG,WAAA,gBAAA,CAnHJlG,GAAAA,IAArB+F,EAAA,CADCQ,EAAc,gBACMvG,CAAAA,GAAAA,CAAAA;"}
|
package/dist/option-0le6-QeS.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const p=require("./tailwind.mixin-CBhPue3q.cjs"),u=require("lit"),r=require("lit/decorators.js");var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,l=(t,e,n,i)=>{for(var a,o=i>1?void 0:i?y(e,n):e,c=t.length-1;c>=0;c--)(a=t[c])&&(o=(i?a(e,n,o):a(o))||o);return i&&o&&d(e,n,o),o};let s=class extends p.TailwindElement(){constructor(){super(...arguments),this.value="",this.selected=!1}handleOptionClick(){var t;this.dispatchEvent(new CustomEvent("click",{detail:{value:this.value,label:this.label??((t=this.textContent)==null?void 0:t.trim())??""},bubbles:!0,composed:!0}))}focus(){var t,e;(e=(t=this.shadowRoot)==null?void 0:t.querySelector("li"))==null||e.focus()}render(){const t={"outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 rounded-md focus-visible:outline-secondary-default":!0,"font-semibold relative cursor-pointer py-2 px-3":!0,"bg-secondary-container text-secondery-onContainer":this.selected};return u.html`
|
|
2
|
-
<li
|
|
3
|
-
tabindex="0"
|
|
4
|
-
class="${this.classMap(t)}"
|
|
5
|
-
role="option"
|
|
6
|
-
@click=${e=>{e.stopPropagation(),e.preventDefault(),this.handleOptionClick()}}
|
|
7
|
-
@keydown=${e=>{e.key!=="Enter"&&e.key!==" "||(e.stopPropagation(),e.preventDefault(),this.handleOptionClick())}}
|
|
8
|
-
>
|
|
9
|
-
<div class="${this.classMap({"duration-500 transition-opacity":!0,"hover:bg-surface-on opacity-[0.08] cursor-pointer absolute inset-0":!0})}"></div>
|
|
10
|
-
<sch-flex class="text-start" align="center" justify="between" flow="row">
|
|
11
|
-
<slot class="self-start"></slot>
|
|
12
|
-
<slot name="support">
|
|
13
|
-
<span></span>
|
|
14
|
-
</slot>
|
|
15
|
-
</sch-flex>
|
|
16
|
-
</li>
|
|
17
|
-
`}};l([r.property({type:String,reflect:!0})],s.prototype,"value",2),l([r.property({type:String,reflect:!0})],s.prototype,"label",2),l([r.property({type:Boolean})],s.prototype,"selected",2),s=l([r.customElement("schmancy-option")],s);
|
|
18
|
-
//# sourceMappingURL=option-0le6-QeS.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"option-0le6-QeS.cjs","sources":["../src/option/option.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nexport type SchmancyOptionChangeEvent = CustomEvent<{\n\tvalue: string\n\tlabel: string\n}>\n\n@customElement('schmancy-option')\nexport default class SchmancyOption extends TailwindElement() {\n\t@property({ type: String, reflect: true }) value: string = ''\n\t@property({ type: String, reflect: true }) label: string | undefined\n\t@property({ type: Boolean }) selected: boolean = false\n\n\tprivate handleOptionClick() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancyOptionChangeEvent['detail']>('click', {\n\t\t\t\tdetail: {\n\t\t\t\t\tvalue: this.value,\n\t\t\t\t\tlabel: this.label ?? this.textContent?.trim() ?? '',\n\t\t\t\t},\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t// override focus method to focus the native element\n\tfocus() {\n\t\tthis.shadowRoot?.querySelector('li')?.focus()\n\t}\n\n\tprotected render() {\n\t\t// Apply highlight styles if `this.selected` is true\n\t\tconst classes = {\n\t\t\t'outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 rounded-md focus-visible:outline-secondary-default':\n\t\t\t\ttrue,\n\t\t\t'font-semibold relative cursor-pointer py-2 px-3': true,\n\t\t\t'bg-secondary-container text-secondery-onContainer': this.selected,\n\t\t}\n\t\tconst stateLayerClasses = {\n\t\t\t'duration-500 transition-opacity': true,\n\t\t\t'hover:bg-surface-on opacity-[0.08] cursor-pointer absolute inset-0': true,\n\t\t}\n\n\t\treturn html`\n\t\t\t<li\n\t\t\t\ttabindex=\"0\"\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\trole=\"option\"\n\t\t\t\t@click=${(e: MouseEvent) => {\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\tthis.handleOptionClick()\n\t\t\t\t}}\n\t\t\t\t@keydown=${(e: KeyboardEvent) => {\n\t\t\t\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tthis.handleOptionClick()\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div class=\"${this.classMap(stateLayerClasses)}\"></div>\n\t\t\t\t<sch-flex class=\"text-start\" align=\"center\" justify=\"between\" flow=\"row\">\n\t\t\t\t\t<slot class=\"self-start\"></slot>\n\t\t\t\t\t<slot name=\"support\">\n\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</slot>\n\t\t\t\t</sch-flex>\n\t\t\t</li>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-option': SchmancyOption\n\t}\n}\n"],"names":["SchmancyOption","TailwindElement","constructor","super","arguments","this","value","selected","handleOptionClick","dispatchEvent","CustomEvent","detail","label","textContent","trim","bubbles","composed","focus","shadowRoot","querySelector","classes","html","classMap","e","stopPropagation","preventDefault","key","__decorateClass","property","type","String","reflect","prototype","Boolean","customElement"],"mappings":"4YAUA,IAAqBA,EAArB,cAA4CC,EAAAA,gBAAAA,CAAAA,CAA5C,aAAAC,CAAAC,MAAAC,GAAAA,SAAAA,EAC4DC,KAAAC,MAAA,GAEVD,KAAAE,SAAAA,EAAA,CAEzC,mBAAAC,OACFH,KAAAI,cACJ,IAAIC,YAAiD,QAAS,CAC7DC,OAAQ,CACPL,MAAOD,KAAKC,MACZM,MAAOP,KAAKO,SAASP,EAAAA,KAAKQ,cAALR,YAAAA,EAAkBS,SAAU,EAElDC,EAAAA,QAAAA,GACAC,SAAAA,EAEF,CAAA,CAAA,CAAA,CAID,OAAAC,UACCZ,GAAAA,EAAAA,KAAKa,aAALb,YAAAA,EAAiBc,cAAc,QAA/Bd,MAAAA,EAAsCY,OAAM,CAGnC,QAET,CAAA,MAAMG,EAAU,CACf,mKACC,GACD,kDAAmD,GACnD,oDAAqDf,KAAKE,QAOpD,EAAA,OAAAc,EAAAA;AAAAA;AAAAA;AAAAA,aAGIhB,KAAKiB,SAASF,CAAAA,CAAAA;AAAAA;AAAAA,aAEbG,GAAAA,CACTA,EAAEC,gBAAAA,EACFD,EAAEE,eAAAA,EACFpB,KAAKG,kBAAkB,CAAA,CAAA;AAAA,eAEZe,GACG,CAAVA,EAAEG,MAAQ,SAAWH,EAAEG,MAAQ,MAClCH,EAAEC,gBACFD,EAAAA,EAAEE,eACFpB,EAAAA,KAAKG,kBAAkB,EAAA,CAAA;AAAA;AAAA,kBAIXH,KAAKiB,SAvBK,CACzB,kCAAmC,GACnC,qEAAsE,EAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAqBvB,CAAA,EArDNK,EAAA,CAA1CC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,QAAS,EAAA,CAAA,CAAA,EADf/B,EACuBgC,UAAA,QAAA,GACAL,EAAA,CAA1CC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,QAAAA,EAFN/B,CAAAA,CAAAA,EAAAA,EAEuBgC,UAAA,QAAA,CAAA,EACdL,EAAA,CAA5BC,WAAS,CAAEC,KAAMI,WAHEjC,EAGSgC,UAAA,WAAA,CAHThC,EAAAA,EAArB2B,EAAA,CADCO,EAAAA,cAAc,iBACMlC,CAAAA,EAAAA,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"option-_1gW48HB.js","sources":["../src/option/option.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nexport type SchmancyOptionChangeEvent = CustomEvent<{\n\tvalue: string\n\tlabel: string\n}>\n\n@customElement('schmancy-option')\nexport default class SchmancyOption extends TailwindElement() {\n\t@property({ type: String, reflect: true }) value: string = ''\n\t@property({ type: String, reflect: true }) label: string | undefined\n\t@property({ type: Boolean }) selected: boolean = false\n\n\tprivate handleOptionClick() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancyOptionChangeEvent['detail']>('click', {\n\t\t\t\tdetail: {\n\t\t\t\t\tvalue: this.value,\n\t\t\t\t\tlabel: this.label ?? this.textContent?.trim() ?? '',\n\t\t\t\t},\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t// override focus method to focus the native element\n\tfocus() {\n\t\tthis.shadowRoot?.querySelector('li')?.focus()\n\t}\n\n\tprotected render() {\n\t\t// Apply highlight styles if `this.selected` is true\n\t\tconst classes = {\n\t\t\t'outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 rounded-md focus-visible:outline-secondary-default':\n\t\t\t\ttrue,\n\t\t\t'font-semibold relative cursor-pointer py-2 px-3': true,\n\t\t\t'bg-secondary-container text-secondery-onContainer': this.selected,\n\t\t}\n\t\tconst stateLayerClasses = {\n\t\t\t'duration-500 transition-opacity': true,\n\t\t\t'hover:bg-surface-on opacity-[0.08] cursor-pointer absolute inset-0': true,\n\t\t}\n\n\t\treturn html`\n\t\t\t<li\n\t\t\t\ttabindex=\"0\"\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\trole=\"option\"\n\t\t\t\t@click=${(e: MouseEvent) => {\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\tthis.handleOptionClick()\n\t\t\t\t}}\n\t\t\t\t@keydown=${(e: KeyboardEvent) => {\n\t\t\t\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tthis.handleOptionClick()\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div class=\"${this.classMap(stateLayerClasses)}\"></div>\n\t\t\t\t<sch-flex class=\"text-start\" align=\"center\" justify=\"between\" flow=\"row\">\n\t\t\t\t\t<slot class=\"self-start\"></slot>\n\t\t\t\t\t<slot name=\"support\">\n\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</slot>\n\t\t\t\t</sch-flex>\n\t\t\t</li>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-option': SchmancyOption\n\t}\n}\n"],"names":["SchmancyOption","TailwindElement","super","arguments","this","value","selected","handleOptionClick","dispatchEvent","CustomEvent","detail","label","textContent","trim","bubbles","composed","shadowRoot","querySelector","focus","classes","html","classMap","e","stopPropagation","preventDefault","key","__decorateClass","property","type","String","reflect","prototype","Boolean","custom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