@devschile/chucao 1.7.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/dist/chucao/chucao.css +1 -1
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/index.esm.js +1 -1
- package/dist/chucao/index.esm.js.map +1 -1
- package/dist/chucao/p-10658dc9.entry.js +2 -0
- package/dist/chucao/p-10658dc9.entry.js.map +1 -0
- package/dist/chucao/p-19dde4f9.entry.js +2 -0
- package/dist/chucao/p-19dde4f9.entry.js.map +1 -0
- package/dist/chucao/p-2e20c7a1.entry.js +2 -0
- package/dist/chucao/p-2e20c7a1.entry.js.map +1 -0
- package/dist/chucao/p-66dce533.entry.js +2 -0
- package/dist/chucao/p-66dce533.entry.js.map +1 -0
- package/dist/chucao/p-75184fe1.entry.js +2 -0
- package/dist/chucao/p-75184fe1.entry.js.map +1 -0
- package/dist/chucao/p-96c852f5.entry.js +2 -0
- package/dist/chucao/p-96c852f5.entry.js.map +1 -0
- package/dist/chucao/p-BaKXvAYc.js +3 -0
- package/dist/chucao/p-BaKXvAYc.js.map +1 -0
- package/dist/chucao/{p-fe8e9537.entry.js → p-a0ec231a.entry.js} +2 -2
- package/dist/chucao/{p-488c7838.entry.js → p-e48912c7.entry.js} +2 -2
- package/dist/chucao/{p-20492b73.entry.js → p-f04d2f75.entry.js} +2 -2
- package/dist/chucao/{p-053d58a4.entry.js → p-f62e1da2.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +185 -8
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +62 -3
- package/dist/cjs/ch-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-divider.cjs.entry.js +1 -1
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +167 -0
- package/dist/cjs/ch-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +62 -3
- package/dist/cjs/ch-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ch-textarea.cjs.entry.js +62 -3
- package/dist/cjs/ch-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-tooltip.cjs.entry.js +82 -0
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/{index-ls4U227d.js → index-C9Abf0td.js} +204 -9
- package/dist/cjs/index-C9Abf0td.js.map +1 -0
- package/dist/cjs/index.cjs.js +5 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.css +10 -0
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +64 -4
- package/dist/collection/components/ch-checkbox/ch-checkbox.js.map +1 -1
- package/dist/collection/components/ch-input/ch-input.css +11 -0
- package/dist/collection/components/ch-input/ch-input.js +64 -4
- package/dist/collection/components/ch-input/ch-input.js.map +1 -1
- package/dist/collection/components/ch-modal/ch-modal.css +69 -0
- package/dist/collection/components/ch-modal/ch-modal.js +278 -0
- package/dist/collection/components/ch-modal/ch-modal.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.css +10 -0
- package/dist/collection/components/ch-radio/ch-radio.js +64 -4
- package/dist/collection/components/ch-radio/ch-radio.js.map +1 -1
- package/dist/collection/components/ch-select/ch-select.css +11 -0
- package/dist/collection/components/ch-select/ch-select.js +64 -4
- package/dist/collection/components/ch-select/ch-select.js.map +1 -1
- package/dist/collection/components/ch-switch/ch-switch.css +10 -0
- package/dist/collection/components/ch-switch/ch-switch.js +64 -4
- package/dist/collection/components/ch-switch/ch-switch.js.map +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.css +11 -0
- package/dist/collection/components/ch-textarea/ch-textarea.js +64 -4
- package/dist/collection/components/ch-textarea/ch-textarea.js.map +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.css +100 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +168 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -0
- package/dist/collection/tokens/tokens.js +4 -0
- package/dist/collection/tokens/tokens.js.map +1 -1
- package/dist/collection/tokens/types.js.map +1 -1
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-checkbox.js.map +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-input.js.map +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.d.ts +11 -0
- package/dist/components/ch-modal.js +2 -0
- package/dist/components/ch-modal.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-radio.js.map +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-select.js.map +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-switch.js.map +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-textarea.js.map +1 -1
- package/dist/components/ch-tooltip.d.ts +11 -0
- package/dist/components/ch-tooltip.js +2 -0
- package/dist/components/ch-tooltip.js.map +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-DL-bL54o.js +2 -0
- package/dist/components/p-DL-bL54o.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +185 -8
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +62 -3
- package/dist/esm/ch-checkbox.entry.js.map +1 -1
- package/dist/esm/ch-divider.entry.js +1 -1
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +165 -0
- package/dist/esm/ch-modal.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +62 -3
- package/dist/esm/ch-radio.entry.js.map +1 -1
- package/dist/esm/ch-tabs.entry.js +1 -1
- package/dist/esm/ch-textarea.entry.js +62 -3
- package/dist/esm/ch-textarea.entry.js.map +1 -1
- package/dist/esm/ch-tooltip.entry.js +80 -0
- package/dist/esm/ch-tooltip.entry.js.map +1 -0
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/{index-pfWAsOzE.js → index-BaKXvAYc.js} +204 -10
- package/dist/esm/index-BaKXvAYc.js.map +1 -0
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-checkbox/ch-checkbox.d.ts +9 -0
- package/dist/types/components/ch-input/ch-input.d.ts +9 -0
- package/dist/types/components/ch-modal/ch-modal.d.ts +67 -0
- package/dist/types/components/ch-radio/ch-radio.d.ts +9 -0
- package/dist/types/components/ch-select/ch-select.d.ts +9 -0
- package/dist/types/components/ch-switch/ch-switch.d.ts +9 -0
- package/dist/types/components/ch-textarea/ch-textarea.d.ts +9 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +47 -0
- package/dist/types/components.d.ts +240 -0
- package/dist/types/tokens/tokens.d.ts +4 -0
- package/dist/types/tokens/types.d.ts +1 -1
- package/dist-react/components.d.ts +10 -1
- package/dist-react/components.js +21 -0
- package/dist-react/components.ts +31 -1
- package/dist-vue/index.d.ts +2 -0
- package/dist-vue/index.js +15 -0
- package/dist-vue/index.ts +19 -0
- package/hydrate/index.js +836 -61
- package/hydrate/index.mjs +836 -61
- package/package.json +4 -1
- package/dist/chucao/p-0305f2eb.entry.js +0 -2
- package/dist/chucao/p-0305f2eb.entry.js.map +0 -1
- package/dist/chucao/p-9a614e82.entry.js +0 -2
- package/dist/chucao/p-9a614e82.entry.js.map +0 -1
- package/dist/chucao/p-ad3206a2.entry.js +0 -2
- package/dist/chucao/p-ad3206a2.entry.js.map +0 -1
- package/dist/chucao/p-c598f978.entry.js +0 -2
- package/dist/chucao/p-c598f978.entry.js.map +0 -1
- package/dist/chucao/p-pfWAsOzE.js +0 -3
- package/dist/chucao/p-pfWAsOzE.js.map +0 -1
- package/dist/cjs/index-ls4U227d.js.map +0 -1
- package/dist/components/p-ONE3uKkF.js +0 -2
- package/dist/components/p-ONE3uKkF.js.map +0 -1
- package/dist/esm/index-pfWAsOzE.js.map +0 -1
- /package/dist/chucao/{p-fe8e9537.entry.js.map → p-a0ec231a.entry.js.map} +0 -0
- /package/dist/chucao/{p-488c7838.entry.js.map → p-e48912c7.entry.js.map} +0 -0
- /package/dist/chucao/{p-20492b73.entry.js.map → p-f04d2f75.entry.js.map} +0 -0
- /package/dist/chucao/{p-053d58a4.entry.js.map → p-f62e1da2.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"ch-textarea.cjs.entry.js","mappings":";;;;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC,ssCAAssC,CAAC;;ACEpuC,IAAI,WAAW,GAAG,CAAC;AAEnB,MAAM,YAAY,GAAG,CAAC;MAOT,UAAU,GAAA,MAAA;;;;;;AACJ,IAAA,UAAU,GAAG,CAAA,YAAA,EAAe,EAAE,WAAW,EAAE;AAC3C,IAAA,MAAM,GAAG,CAAA,EAAG,IAAI,CAAC,UAAU,OAAO;AAClC,IAAA,OAAO,GAAG,CAAA,EAAG,IAAI,CAAC,UAAU,QAAQ;AAErD;;;AAGG;AACK,IAAA,KAAK;AAEb;;AAEG;IACsB,KAAK,GAAG,EAAE;AAEnC;;AAEG;AACK,IAAA,WAAW;AAEnB;;AAEG;IACK,IAAI,GAAG,Y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,GAAG,SAAS,EAC5C,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,OAAO,EAAE,EAC9D,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,cAAA,EACH,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG,SAAS,EAAA,kBAAA,EAC7B,IAAI,CAAC,WAAW,EAClC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAA,CACjB,EACX,IAAI,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,KAChDA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,MAAM,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAA,EAC5B,IAAI,CAAC,IAAI,CACR,CACL,EACA,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,KAChCA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAC,OAAO,EAAA,EAC5C,IAAI,CAAC,YAAY,CAChB,CACL,CACI;;;;;;;","names":["h","Host"],"sources":["src/components/ch-textarea/ch-textarea.css?tag=ch-textarea&encapsulation=shadow","src/components/ch-textarea/ch-textarea.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.textarea {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--spacing-6xl);\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n line-height: var(--spacing-5xl);\n resize: vertical;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.textarea::placeholder {\n color: var(--text-muted);\n}\n\n.textarea:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.textarea--invalid {\n border-color: var(--color-status-warning);\n}\n\n.textarea--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.textarea:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nlet textareaIds = 0;\n\nconst DEFAULT_ROWS = 4;\n\n@Component({\n tag: 'ch-textarea',\n styleUrl: 'ch-textarea.css',\n shadow: true,\n})\nexport class ChTextarea {\n private readonly textareaId = `ch-textarea-${++textareaIds}`;\n private readonly hintId = `${this.textareaId}-hint`;\n private readonly errorId = `${this.textareaId}-error`;\n\n /**\n * Visible label rendered above the textarea and associated with it via\n * `for`/`id`, so assistive technology announces the textarea's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The value of the textarea.\n */\n @Prop({ mutable: true }) value = '';\n\n /**\n * Placeholder text shown when the textarea is empty.\n */\n @Prop() placeholder?: string;\n\n /**\n * The number of visible rows of the textarea.\n */\n @Prop() rows = DEFAULT_ROWS;\n\n /**\n * The name of the textarea, submitted with form data.\n */\n @Prop() name?: string;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether the textarea is required.\n */\n @Prop() required = false;\n\n /**\n * Helper text rendered below the textarea, associated via `aria-describedby`.\n * Replaced by `errorMessage` when the textarea is invalid.\n */\n @Prop() hint?: string;\n\n /**\n * Error message rendered below the textarea when it is invalid.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Whether the textarea is in an invalid state; toggles `aria-invalid` and error styling.\n */\n @Prop() invalid = false;\n\n /**\n * Emitted on every keystroke, with the current textarea value.\n */\n @Event() chInput: EventEmitter<string>;\n\n /**\n * Emitted when the textarea value is committed (on native `change`).\n */\n @Event() chChange: EventEmitter<string>;\n\n private handleInput = (ev: InputEvent) => {\n this.value = (ev.target as HTMLTextAreaElement).value;\n this.chInput.emit(this.value);\n };\n\n private handleChange = (ev: Event) => {\n this.value = (ev.target as HTMLTextAreaElement).value;\n this.chChange.emit(this.value);\n };\n\n private get describedBy(): string | undefined {\n if (this.invalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.textareaId}>\n {this.label}\n </label>\n )}\n <textarea\n id={this.label ? this.textareaId : undefined}\n class={{ 'textarea': true, 'textarea--invalid': this.invalid }}\n rows={this.rows}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.value}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onChange={this.handleChange}\n ></textarea>\n {this.hint && !(this.invalid && this.errorMessage) && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {this.invalid && this.errorMessage && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"ch-textarea.cjs.entry.js","mappings":";;;;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC,8+CAA8+C,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,IAAI,CAAC,MAAM,EAAA,EAC5B,IAAI,CAAC,IAAI,CACR,CACL,EACA,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,KAChCA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAC,OAAO,EAAA,EAC5C,IAAI,CAAC,YAAY,CAChB,CACL,CACI;;;;;;;;;;;;;;;;;;;;;;","names":["h","Host"],"sources":["src/components/ch-textarea/ch-textarea.css?tag=ch-textarea&encapsulation=shadow","src/components/ch-textarea/ch-textarea.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.textarea {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--spacing-6xl);\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n line-height: var(--spacing-5xl);\n resize: vertical;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.textarea::placeholder {\n color: var(--text-muted);\n}\n\n.textarea:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.textarea--invalid {\n border-color: var(--color-status-warning);\n}\n\n.textarea--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n:host([data-touched]:invalid) .textarea,\n:host(:user-invalid) .textarea {\n border-color: var(--color-status-warning);\n}\n\n:host([data-touched]:invalid) .textarea:focus,\n:host(:user-invalid) .textarea:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.textarea:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n","import { AttachInternals, Component, Element, Event, type EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\nlet textareaIds = 0;\n\nconst DEFAULT_ROWS = 4;\n\n@Component({\n tag: 'ch-textarea',\n styleUrl: 'ch-textarea.css',\n shadow: true,\n formAssociated: true,\n})\nexport class ChTextarea {\n private readonly textareaId = `ch-textarea-${++textareaIds}`;\n private readonly hintId = `${this.textareaId}-hint`;\n private readonly errorId = `${this.textareaId}-error`;\n private initialValue = '';\n\n @AttachInternals() internals!: ElementInternals;\n @State() formDisabled = false;\n @Element() private host!: HTMLElement;\n\n /**\n * Visible label rendered above the textarea and associated with it via\n * `for`/`id`, so assistive technology announces the textarea's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The value of the textarea.\n */\n @Prop({ mutable: true }) value = '';\n\n /**\n * Placeholder text shown when the textarea is empty.\n */\n @Prop() placeholder?: string;\n\n /**\n * The number of visible rows of the textarea.\n */\n @Prop() rows = DEFAULT_ROWS;\n\n /**\n * The name of the textarea, submitted with form data.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Whether the textarea is required.\n */\n @Prop({ reflect: true }) required = false;\n\n /**\n * Helper text rendered below the textarea, associated via `aria-describedby`.\n * Replaced by `errorMessage` when the textarea is invalid.\n */\n @Prop() hint?: string;\n\n /**\n * Error message rendered below the textarea when it is invalid.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Whether the textarea is in an invalid state; toggles `aria-invalid` and error styling.\n */\n @Prop() invalid = false;\n\n /**\n * Emitted on every keystroke, with the current textarea value.\n */\n @Event() chInput: EventEmitter<string>;\n\n /**\n * Emitted when the textarea value is committed (on native `change`).\n */\n @Event() chChange: EventEmitter<string>;\n\n private handleInput = (ev: InputEvent) => {\n this.value = (ev.target as HTMLTextAreaElement).value;\n this.chInput.emit(this.value);\n };\n\n private handleChange = (ev: Event) => {\n this.value = (ev.target as HTMLTextAreaElement).value;\n this.chChange.emit(this.value);\n };\n\n @Watch('value')\n @Watch('required')\n @Watch('invalid')\n @Watch('errorMessage')\n protected syncForm(): void {\n const internals = this.internals;\n if (typeof internals?.setFormValue !== 'function') {\n return;\n }\n internals.setFormValue(this.value);\n const flags: ValidityStateFlags = {};\n let message: string | undefined;\n if (this.required && this.value === '') {\n flags.valueMissing = true;\n }\n if (this.invalid && this.errorMessage) {\n flags.customError = true;\n }\n message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);\n internals.setValidity(flags, message);\n }\n\n componentDidLoad() {\n this.initialValue = this.value;\n this.syncForm();\n this.host.addEventListener('change', this.markTouched);\n this.host.addEventListener('focusout', this.markTouched);\n this.host.addEventListener('invalid', this.markTouched);\n }\n\n private markTouched = (): void => {\n this.host.setAttribute('data-touched', '');\n };\n\n formResetCallback(): void {\n this.value = this.initialValue;\n }\n\n formDisabledCallback(isDisabled: boolean): void {\n this.formDisabled = isDisabled;\n }\n\n private get describedBy(): string | undefined {\n if (this.invalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.textareaId}>\n {this.label}\n </label>\n )}\n <textarea\n id={this.label ? this.textareaId : undefined}\n class={{ 'textarea': true, 'textarea--invalid': this.invalid }}\n rows={this.rows}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled || this.formDisabled}\n required={this.required}\n value={this.value}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onChange={this.handleChange}\n ></textarea>\n {this.hint && !(this.invalid && this.errorMessage) && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {this.invalid && this.errorMessage && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-C9Abf0td.js');
|
|
4
|
+
|
|
5
|
+
const chTooltipCss = () => `:host{display:inline-block}.anchor{position:relative;display:inline-flex}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:16rem;padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;
|
|
6
|
+
|
|
7
|
+
let tooltipIds = 0;
|
|
8
|
+
const ChTooltip = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
}
|
|
12
|
+
get el() { return index.getElement(this); }
|
|
13
|
+
fallbackId = `ch-tooltip-${++tooltipIds}`;
|
|
14
|
+
/**
|
|
15
|
+
* Which side of the trigger the bubble is placed on.
|
|
16
|
+
*/
|
|
17
|
+
placement = 'top';
|
|
18
|
+
// Hover and focus are tracked apart so that neither cancels the other: a
|
|
19
|
+
// pointer passing over and away must not hide a tooltip whose trigger still
|
|
20
|
+
// holds keyboard focus.
|
|
21
|
+
hovered = false;
|
|
22
|
+
focused = false;
|
|
23
|
+
dismissed = false;
|
|
24
|
+
get visible() {
|
|
25
|
+
return (this.hovered || this.focused) && !this.dismissed;
|
|
26
|
+
}
|
|
27
|
+
componentDidLoad() {
|
|
28
|
+
this.associate();
|
|
29
|
+
}
|
|
30
|
+
handleMouseEnter() {
|
|
31
|
+
this.hovered = true;
|
|
32
|
+
this.dismissed = false;
|
|
33
|
+
}
|
|
34
|
+
handleMouseLeave() {
|
|
35
|
+
this.hovered = false;
|
|
36
|
+
}
|
|
37
|
+
handleFocusIn() {
|
|
38
|
+
this.focused = true;
|
|
39
|
+
this.dismissed = false;
|
|
40
|
+
}
|
|
41
|
+
handleFocusOut() {
|
|
42
|
+
this.focused = false;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Listens on the document because a tooltip opened by hovering leaves focus
|
|
46
|
+
* wherever it was, so a host-scoped handler would never see the key.
|
|
47
|
+
*/
|
|
48
|
+
handleKeyDown(event) {
|
|
49
|
+
if (event.key === 'Escape' && this.visible) {
|
|
50
|
+
this.dismissed = true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
slotted(name) {
|
|
54
|
+
return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Points the trigger at the text with `aria-describedby`. Re-run on
|
|
58
|
+
* `slotchange` because a framework re-render can replace the slotted nodes
|
|
59
|
+
* and take the attributes with them.
|
|
60
|
+
*/
|
|
61
|
+
associate = () => {
|
|
62
|
+
const trigger = this.slotted('trigger');
|
|
63
|
+
const content = this.slotted('content');
|
|
64
|
+
if (!trigger || !content) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!content.id) {
|
|
68
|
+
content.id = this.fallbackId;
|
|
69
|
+
}
|
|
70
|
+
content.setAttribute('role', 'tooltip');
|
|
71
|
+
trigger.setAttribute('aria-describedby', content.id);
|
|
72
|
+
};
|
|
73
|
+
render() {
|
|
74
|
+
return (index.h(index.Host, { key: '654d4a12f84c94e014691e911e7c63c6c45b8755' }, index.h("span", { key: '726269e02fedc37efc39f1561d8b9baf83d6a4cc', class: "anchor" }, index.h("slot", { key: '876cb19249032d6d1c66f22bd2c255683b6a7f66', name: "trigger", onSlotchange: this.associate }), index.h("span", { key: '7436eb75b40b33d0b6c8ce194245d4a08a29facb', class: { 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible } }, index.h("slot", { key: '24648cc6078d61803793df011058da9515b466b5', name: "content", onSlotchange: this.associate })))));
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
ChTooltip.style = chTooltipCss();
|
|
78
|
+
|
|
79
|
+
exports.ch_tooltip = ChTooltip;
|
|
80
|
+
//# sourceMappingURL=ch-tooltip.entry.cjs.js.map
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=ch-tooltip.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"ch-tooltip.cjs.entry.js","mappings":";;;;AAAA,MAAM,YAAY,GAAG,MAAM,CAAC,02CAA02C,CAAC;;ACIv4C,IAAI,UAAU,GAAG,CAAC;MAuBL,SAAS,GAAA,MAAA;;;;;AAGH,IAAA,UAAU,GAAG,CAAA,WAAA,EAAc,EAAE,UAAU,EAAE;AAE1D;;AAEG;IACK,SAAS,GAAuB,KAAK;;;;IAKpC,OAAO,GAAG,KAAK;IACf,OAAO,GAAG,KAAK;IACf,SAAS,GAAG,KAAK;AAE1B,IAAA,IAAY,OAAO,GAAA;AACjB,QAAA,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,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C,EAAE,CAAC;AACtD,KAAC;IAED,MAAM,GAAA;QACJ,QACEA,QAACC,UAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACHD,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,QAAQ,EAAA,EAClBA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,EAC1DA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA,QAAA,EAAW,IAAI,CAAC,SAAS,CAAA,CAAE,GAAG,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,OAAO,EAAE,EAAA,EACnGA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,CACrD,CACF,CACF;;;;;;;","names":["h","Host"],"sources":["src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: 16rem;\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, Host, Listen, Prop, State, h } from '@stencil/core';\n\nexport type ChTooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nlet tooltipIds = 0;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n /**\n * Which side of the trigger the bubble is placed on.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible) {\n this.dismissed = true;\n }\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n return (\n <Host>\n <span class=\"anchor\">\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span class={{ 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible }}>\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n"],"version":3}
|
package/dist/cjs/chucao.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-C9Abf0td.js');
|
|
4
4
|
|
|
5
5
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
6
6
|
/*
|
|
@@ -18,7 +18,7 @@ var patchBrowser = () => {
|
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(async (options) => {
|
|
20
20
|
await index.globalScripts();
|
|
21
|
-
return index.bootstrapLazy([["ch-alert_8.cjs",[[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[
|
|
21
|
+
return index.bootstrapLazy([["ch-alert_8.cjs",[[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-radio.cjs",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"]]]]]], options);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
exports.setNonce = index.setNonce;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const NAMESPACE = 'chucao';
|
|
4
|
-
const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true,
|
|
4
|
+
const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
|
|
5
5
|
|
|
6
6
|
const globalScripts = () => {};
|
|
7
|
-
const globalStyles = ":root{--color-background-base:#100a1c;--color-background-top-glow:#201e40;--color-background-bottom-glow:#261226;--color-surface-default:rgba(32, 30, 64, 0.6);--color-surface-hover:rgba(45, 212, 191, 0.08);--color-border-default:rgba(255, 255, 255, 0.08);--color-border-hover:rgba(45, 212, 191, 0.3);--color-accent-default:#2dd4bf;--color-accent-hover:#5ee8d4;--color-accent-text:#06210f;--color-status-positive:#4ade80;--color-status-positive-background:rgba(34, 197, 94, 0.18);--color-status-warning:#f87171;--color-status-warning-background:rgba(248, 113, 113, 0.15);--color-text-primary:#ffffff;--color-text-secondary:rgba(255, 255, 255, 0.55);--color-brand-huemul-dark:#85422b;--color-brand-huemul-light:#b45b38;--color-brand-stroke:#1d1d1b;--typography-body:Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--typography-heading:Inconsolata, monospace;--typography-size-xs:0.68rem;--typography-size-sm:0.85rem;--typography-size-md:1rem;--typography-size-lg:1.25rem;--typography-size-xl:1.5rem;--typography-weight-regular:400;--typography-weight-semibold:600;--typography-weight-bold:700;--typography-tracking-badge:0.03em;--spacing-2xs:0.18rem;--spacing-xs:0.25rem;--spacing-sm:0.35rem;--spacing-md:0.5rem;--spacing-lg:0.6rem;--spacing-xl:0.8rem;--spacing-2xl:1rem;--spacing-3xl:1.25rem;--spacing-4xl:1.35rem;--spacing-5xl:1.5rem;--spacing-6xl:2rem;--spacing-shift:2px;--spacing-elevate:1px;--radius-sm:6px;--radius-md:8px;--radius-pill:999px;--border-width:1px;--border-accent-bar:3px;--shadow-focus-ring:0 0 0 3px rgba(45, 212, 191, 0.12);--shadow-card-hover:0 4px 20px rgba(45, 212, 191, 0.06);--effect-blur:10px;--duration-fast:150ms;--duration-normal:200ms;--duration-spin:800ms;--easing-default:ease;--easing-linear:linear;--focus-outline-width:2px;--focus-outline-offset:2px;--opacity-disabled:0.5;--z-index-base:0;--z-index-dropdown:100;--z-index-modal:1000;--layout-max-width:68rem}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-400-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:600;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-600-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:700;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-700-normal.woff2') format('woff2')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/inconsolata-latin-400-normal.woff2') format('woff2')}:root{--bg:var(--color-background-base);--bg-gradient:radial-gradient(50% 30% ellipse at center top, var(--color-background-top-glow) 0%, rgba(0, 0, 0, 0) 100%),\n radial-gradient(60% 50% ellipse at center bottom, var(--color-background-bottom-glow) 0%, var(--color-background-base) 100%);--surface:var(--color-surface-default);--surface-hover:var(--color-surface-hover);--border:var(--color-border-default);--border-hover:var(--color-border-hover);--text:var(--color-text-primary);--text-muted:var(--color-text-secondary);--accent:var(--color-accent-default);--accent-hover:var(--color-accent-hover);--font-body:var(--typography-body);--font-heading:var(--typography-heading);--radius:var(--radius-sm)}body{font-family:var(--font-body)}.ch-container{width:100%;max-width:var(--layout-max-width);margin-inline:auto}.ch-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.ch-flex{display:flex}.ch-flex-col{display:flex;flex-direction:column}.ch-items-center{align-items:center}.ch-justify-center{justify-content:center}.ch-justify-between{justify-content:space-between}.ch-gap-sm{gap:var(--spacing-md)}.ch-gap-md{gap:var(--spacing-2xl)}.ch-text-center{text-align:center}.ch-text-primary{color:var(--text)}.ch-text-muted{color:var(--text-muted)}.ch-text-accent{color:var(--accent)}.ch-heading{font-family:var(--font-heading)}";
|
|
7
|
+
const globalStyles = ":root{--color-background-base:#100a1c;--color-background-top-glow:#201e40;--color-background-bottom-glow:#261226;--color-surface-default:rgba(32, 30, 64, 0.6);--color-surface-hover:rgba(45, 212, 191, 0.08);--color-scrim-default:rgba(0, 0, 0, 0.6);--color-border-default:rgba(255, 255, 255, 0.08);--color-border-hover:rgba(45, 212, 191, 0.3);--color-accent-default:#2dd4bf;--color-accent-hover:#5ee8d4;--color-accent-text:#06210f;--color-status-positive:#4ade80;--color-status-positive-background:rgba(34, 197, 94, 0.18);--color-status-warning:#f87171;--color-status-warning-background:rgba(248, 113, 113, 0.15);--color-text-primary:#ffffff;--color-text-secondary:rgba(255, 255, 255, 0.55);--color-brand-huemul-dark:#85422b;--color-brand-huemul-light:#b45b38;--color-brand-stroke:#1d1d1b;--typography-body:Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--typography-heading:Inconsolata, monospace;--typography-size-xs:0.68rem;--typography-size-sm:0.85rem;--typography-size-md:1rem;--typography-size-lg:1.25rem;--typography-size-xl:1.5rem;--typography-weight-regular:400;--typography-weight-semibold:600;--typography-weight-bold:700;--typography-tracking-badge:0.03em;--spacing-2xs:0.18rem;--spacing-xs:0.25rem;--spacing-sm:0.35rem;--spacing-md:0.5rem;--spacing-lg:0.6rem;--spacing-xl:0.8rem;--spacing-2xl:1rem;--spacing-3xl:1.25rem;--spacing-4xl:1.35rem;--spacing-5xl:1.5rem;--spacing-6xl:2rem;--spacing-shift:2px;--spacing-elevate:1px;--radius-sm:6px;--radius-md:8px;--radius-pill:999px;--border-width:1px;--border-accent-bar:3px;--shadow-focus-ring:0 0 0 3px rgba(45, 212, 191, 0.12);--shadow-card-hover:0 4px 20px rgba(45, 212, 191, 0.06);--effect-blur:10px;--duration-fast:150ms;--duration-normal:200ms;--duration-spin:800ms;--easing-default:ease;--easing-linear:linear;--focus-outline-width:2px;--focus-outline-offset:2px;--opacity-disabled:0.5;--z-index-base:0;--z-index-dropdown:100;--z-index-modal:1000;--layout-max-width:68rem}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-400-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:600;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-600-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:700;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-700-normal.woff2') format('woff2')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/inconsolata-latin-400-normal.woff2') format('woff2')}:root{--bg:var(--color-background-base);--bg-gradient:radial-gradient(50% 30% ellipse at center top, var(--color-background-top-glow) 0%, rgba(0, 0, 0, 0) 100%),\n radial-gradient(60% 50% ellipse at center bottom, var(--color-background-bottom-glow) 0%, var(--color-background-base) 100%);--surface:var(--color-surface-default);--surface-hover:var(--color-surface-hover);--border:var(--color-border-default);--border-hover:var(--color-border-hover);--text:var(--color-text-primary);--text-muted:var(--color-text-secondary);--accent:var(--color-accent-default);--accent-hover:var(--color-accent-hover);--font-body:var(--typography-body);--font-heading:var(--typography-heading);--radius:var(--radius-sm)}body{font-family:var(--font-body)}.ch-container{width:100%;max-width:var(--layout-max-width);margin-inline:auto}.ch-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.ch-flex{display:flex}.ch-flex-col{display:flex;flex-direction:column}.ch-items-center{align-items:center}.ch-justify-center{justify-content:center}.ch-justify-between{justify-content:space-between}.ch-gap-sm{gap:var(--spacing-md)}.ch-gap-md{gap:var(--spacing-2xl)}.ch-text-center{text-align:center}.ch-text-primary{color:var(--text)}.ch-text-muted{color:var(--text-muted)}.ch-text-accent{color:var(--accent)}.ch-heading{font-family:var(--font-heading)}";
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
Stencil Client Platform v4.44.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -87,7 +87,7 @@ var registerInstance = (lazyInstance, hostRef) => {
|
|
|
87
87
|
if (!hostRef) return;
|
|
88
88
|
lazyInstance.__stencil__getHostRef = () => hostRef;
|
|
89
89
|
hostRef.$lazyInstance$ = lazyInstance;
|
|
90
|
-
if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.
|
|
90
|
+
if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
|
|
91
91
|
reWireGetterSetter(lazyInstance, hostRef);
|
|
92
92
|
}
|
|
93
93
|
};
|
|
@@ -170,6 +170,12 @@ var HYDRATE_CHILD_ID = "c-id";
|
|
|
170
170
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
171
171
|
var MAX_LAZY_LOAD_RETRIES = 3;
|
|
172
172
|
var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
|
|
173
|
+
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
174
|
+
"formAssociatedCallback",
|
|
175
|
+
"formResetCallback",
|
|
176
|
+
"formDisabledCallback",
|
|
177
|
+
"formStateRestoreCallback"
|
|
178
|
+
];
|
|
173
179
|
var win = typeof window !== "undefined" ? window : {};
|
|
174
180
|
var plt = {
|
|
175
181
|
$flags$: 0,
|
|
@@ -180,6 +186,23 @@ var plt = {
|
|
|
180
186
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
181
187
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
182
188
|
};
|
|
189
|
+
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
190
|
+
var _a;
|
|
191
|
+
let supportsListenerOptions2 = false;
|
|
192
|
+
try {
|
|
193
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
194
|
+
"e",
|
|
195
|
+
null,
|
|
196
|
+
Object.defineProperty({}, "passive", {
|
|
197
|
+
get() {
|
|
198
|
+
supportsListenerOptions2 = true;
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
);
|
|
202
|
+
} catch (e) {
|
|
203
|
+
}
|
|
204
|
+
return supportsListenerOptions2;
|
|
205
|
+
})();
|
|
183
206
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
184
207
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
185
208
|
try {
|
|
@@ -966,6 +989,31 @@ var findCorrespondingNode = (node, type) => {
|
|
|
966
989
|
return sibling;
|
|
967
990
|
};
|
|
968
991
|
|
|
992
|
+
// src/runtime/normalize-watchers.ts
|
|
993
|
+
var normalizeWatchers = (raw) => {
|
|
994
|
+
if (!raw) return void 0;
|
|
995
|
+
const keys = Object.keys(raw);
|
|
996
|
+
if (keys.length === 0) return void 0;
|
|
997
|
+
let hasLegacy = false;
|
|
998
|
+
for (const propName of keys) {
|
|
999
|
+
if (hasLegacy) break;
|
|
1000
|
+
for (const h2 of raw[propName]) {
|
|
1001
|
+
if (typeof h2 === "string") {
|
|
1002
|
+
hasLegacy = true;
|
|
1003
|
+
break;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
if (!hasLegacy) return raw;
|
|
1008
|
+
const out = {};
|
|
1009
|
+
for (const propName of keys) {
|
|
1010
|
+
out[propName] = raw[propName].map(
|
|
1011
|
+
(h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
|
|
1012
|
+
);
|
|
1013
|
+
}
|
|
1014
|
+
return out;
|
|
1015
|
+
};
|
|
1016
|
+
|
|
969
1017
|
// src/utils/remote-value.ts
|
|
970
1018
|
var RemoteValue = class _RemoteValue {
|
|
971
1019
|
/**
|
|
@@ -1085,7 +1133,9 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
1085
1133
|
}
|
|
1086
1134
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1087
1135
|
if (propType & 4 /* Boolean */) {
|
|
1088
|
-
{
|
|
1136
|
+
if (isFormAssociated && typeof propValue === "string") {
|
|
1137
|
+
return propValue === "" || !!propValue;
|
|
1138
|
+
} else {
|
|
1089
1139
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1090
1140
|
}
|
|
1091
1141
|
}
|
|
@@ -1538,6 +1588,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1538
1588
|
const isHostElement = isHost(renderFnResults);
|
|
1539
1589
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
1540
1590
|
hostTagName = hostElm.tagName;
|
|
1591
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
1592
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1593
|
+
cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
|
|
1594
|
+
{
|
|
1595
|
+
rootVnode.$attrs$[attribute] = hostElm[propName];
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1541
1599
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1542
1600
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
1543
1601
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -1597,6 +1655,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1597
1655
|
let maybePromise;
|
|
1598
1656
|
if (isInitialLoad) {
|
|
1599
1657
|
{
|
|
1658
|
+
{
|
|
1659
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1660
|
+
if (hostRef.$queuedListeners$) {
|
|
1661
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
1662
|
+
hostRef.$queuedListeners$ = void 0;
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1600
1665
|
if (hostRef.$fetchedCbList$.length) {
|
|
1601
1666
|
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
1602
1667
|
}
|
|
@@ -1729,16 +1794,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1729
1794
|
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
|
|
1730
1795
|
);
|
|
1731
1796
|
}
|
|
1797
|
+
const elm = hostRef.$hostElement$ ;
|
|
1732
1798
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1733
1799
|
const flags = hostRef.$flags$;
|
|
1734
1800
|
const instance = hostRef.$lazyInstance$ ;
|
|
1735
1801
|
newVal = parsePropertyValue(
|
|
1736
1802
|
newVal,
|
|
1737
|
-
cmpMeta.$members$[propName][0]
|
|
1803
|
+
cmpMeta.$members$[propName][0],
|
|
1804
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
1805
|
+
);
|
|
1738
1806
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1739
1807
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1740
1808
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
1741
1809
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1810
|
+
if (cmpMeta.$watchers$) {
|
|
1811
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1812
|
+
if (watchMethods) {
|
|
1813
|
+
watchMethods.map((watcher) => {
|
|
1814
|
+
try {
|
|
1815
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
1816
|
+
if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
|
|
1817
|
+
if (!instance) {
|
|
1818
|
+
hostRef.$fetchedCbList$.push(() => {
|
|
1819
|
+
hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
|
|
1820
|
+
});
|
|
1821
|
+
} else {
|
|
1822
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
} catch (e) {
|
|
1826
|
+
consoleError(e, elm);
|
|
1827
|
+
}
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1742
1831
|
if (flags & 2 /* hasRendered */) {
|
|
1743
1832
|
if (instance.componentShouldUpdate) {
|
|
1744
1833
|
const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
|
|
@@ -1757,7 +1846,38 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1757
1846
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1758
1847
|
var _a, _b;
|
|
1759
1848
|
const prototype = Cstr.prototype;
|
|
1849
|
+
if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
1850
|
+
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
1851
|
+
Object.defineProperty(prototype, cbName, {
|
|
1852
|
+
value(...args) {
|
|
1853
|
+
var _a2;
|
|
1854
|
+
const hostRef = getHostRef(this);
|
|
1855
|
+
const instance = hostRef == null ? void 0 : hostRef.$lazyInstance$ ;
|
|
1856
|
+
if (!instance) {
|
|
1857
|
+
(_a2 = hostRef == null ? void 0 : hostRef.$onReadyPromise$) == null ? void 0 : _a2.then((asyncInstance) => {
|
|
1858
|
+
const cb = asyncInstance[cbName];
|
|
1859
|
+
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
1860
|
+
});
|
|
1861
|
+
} else {
|
|
1862
|
+
const cb = instance[cbName] ;
|
|
1863
|
+
typeof cb === "function" && cb.call(instance, ...args);
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
});
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1760
1869
|
if (cmpMeta.$members$ || BUILD.propChangeCallback) {
|
|
1870
|
+
{
|
|
1871
|
+
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
1872
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
1873
|
+
}
|
|
1874
|
+
if (Cstr.deserializers && !cmpMeta.$deserializers$) {
|
|
1875
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1876
|
+
}
|
|
1877
|
+
if (Cstr.serializers && !cmpMeta.$serializers$) {
|
|
1878
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1761
1881
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1762
1882
|
members.map(([memberName, [memberFlags]]) => {
|
|
1763
1883
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
@@ -1795,7 +1915,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1795
1915
|
origSetter.apply(this, [
|
|
1796
1916
|
parsePropertyValue(
|
|
1797
1917
|
newValue,
|
|
1798
|
-
memberFlags
|
|
1918
|
+
memberFlags,
|
|
1919
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
1920
|
+
)
|
|
1799
1921
|
]);
|
|
1800
1922
|
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1801
1923
|
setValue(this, memberName, newValue, cmpMeta);
|
|
@@ -1820,7 +1942,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1820
1942
|
}
|
|
1821
1943
|
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
1822
1944
|
newValue,
|
|
1823
|
-
memberFlags
|
|
1945
|
+
memberFlags,
|
|
1946
|
+
!!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
1947
|
+
);
|
|
1824
1948
|
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1825
1949
|
};
|
|
1826
1950
|
if (ref.$lazyInstance$) {
|
|
@@ -1879,8 +2003,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1879
2003
|
/* @__PURE__ */ new Set([
|
|
1880
2004
|
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1881
2005
|
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
|
|
2006
|
+
var _a2;
|
|
1882
2007
|
const attrName = m[1] || propName;
|
|
1883
2008
|
attrNameToPropName.set(attrName, propName);
|
|
2009
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
2010
|
+
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2011
|
+
}
|
|
1884
2012
|
return attrName;
|
|
1885
2013
|
})
|
|
1886
2014
|
])
|
|
@@ -1917,6 +2045,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1917
2045
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
1918
2046
|
}
|
|
1919
2047
|
if (!Cstr.isProxied) {
|
|
2048
|
+
{
|
|
2049
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
2050
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
2051
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
2052
|
+
}
|
|
1920
2053
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1921
2054
|
Cstr.isProxied = true;
|
|
1922
2055
|
}
|
|
@@ -1932,6 +2065,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1932
2065
|
{
|
|
1933
2066
|
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1934
2067
|
}
|
|
2068
|
+
{
|
|
2069
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2070
|
+
}
|
|
1935
2071
|
endNewInstance();
|
|
1936
2072
|
{
|
|
1937
2073
|
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
@@ -2022,6 +2158,7 @@ var connectedCallback = (elm) => {
|
|
|
2022
2158
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
2023
2159
|
}
|
|
2024
2160
|
} else {
|
|
2161
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
2025
2162
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2026
2163
|
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
2027
2164
|
} else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
|
|
@@ -2041,6 +2178,12 @@ var disconnectInstance = (instance, elm) => {
|
|
|
2041
2178
|
var disconnectedCallback = async (elm) => {
|
|
2042
2179
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2043
2180
|
const hostRef = getHostRef(elm);
|
|
2181
|
+
{
|
|
2182
|
+
if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
|
|
2183
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2184
|
+
hostRef.$rmListeners$ = void 0;
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2044
2187
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2045
2188
|
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
2046
2189
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
@@ -2082,6 +2225,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2082
2225
|
}
|
|
2083
2226
|
lazyBundles.map((lazyBundle) => {
|
|
2084
2227
|
lazyBundle[1].map((compactMeta) => {
|
|
2228
|
+
var _a2, _b;
|
|
2085
2229
|
const cmpMeta = {
|
|
2086
2230
|
$flags$: compactMeta[0],
|
|
2087
2231
|
$tagName$: compactMeta[1],
|
|
@@ -2091,6 +2235,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2091
2235
|
{
|
|
2092
2236
|
cmpMeta.$members$ = compactMeta[2];
|
|
2093
2237
|
}
|
|
2238
|
+
{
|
|
2239
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
2240
|
+
}
|
|
2241
|
+
{
|
|
2242
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
2243
|
+
}
|
|
2244
|
+
{
|
|
2245
|
+
cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
|
|
2246
|
+
cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
|
|
2247
|
+
cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
|
|
2248
|
+
}
|
|
2094
2249
|
const tagName = transformTag(cmpMeta.$tagName$);
|
|
2095
2250
|
const HostElement = class extends HTMLElement {
|
|
2096
2251
|
["s-p"];
|
|
@@ -2122,6 +2277,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2122
2277
|
}
|
|
2123
2278
|
if (!this.hasRegisteredEventListeners) {
|
|
2124
2279
|
this.hasRegisteredEventListeners = true;
|
|
2280
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
2125
2281
|
}
|
|
2126
2282
|
if (appLoadFallback) {
|
|
2127
2283
|
clearTimeout(appLoadFallback);
|
|
@@ -2155,6 +2311,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2155
2311
|
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
|
|
2156
2312
|
}
|
|
2157
2313
|
};
|
|
2314
|
+
if (cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
2315
|
+
HostElement.formAssociated = true;
|
|
2316
|
+
}
|
|
2158
2317
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
2159
2318
|
if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
|
|
2160
2319
|
cmpTags.push(tagName);
|
|
@@ -2185,6 +2344,41 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2185
2344
|
}
|
|
2186
2345
|
endBootstrap();
|
|
2187
2346
|
};
|
|
2347
|
+
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
2348
|
+
if (listeners && win.document) {
|
|
2349
|
+
listeners.map(([flags, name, method]) => {
|
|
2350
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
2351
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
2352
|
+
const opts = hostListenerOpts(flags);
|
|
2353
|
+
plt.ael(target, name, handler, opts);
|
|
2354
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
};
|
|
2358
|
+
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
2359
|
+
var _a;
|
|
2360
|
+
try {
|
|
2361
|
+
{
|
|
2362
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
2363
|
+
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
2364
|
+
} else {
|
|
2365
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
} catch (e) {
|
|
2369
|
+
consoleError(e, hostRef.$hostElement$);
|
|
2370
|
+
}
|
|
2371
|
+
};
|
|
2372
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
2373
|
+
if (flags & 4 /* TargetDocument */) {
|
|
2374
|
+
return doc;
|
|
2375
|
+
}
|
|
2376
|
+
return elm;
|
|
2377
|
+
};
|
|
2378
|
+
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
2379
|
+
passive: (flags & 1 /* Passive */) !== 0,
|
|
2380
|
+
capture: (flags & 2 /* Capture */) !== 0
|
|
2381
|
+
} : (flags & 2 /* Capture */) !== 0;
|
|
2188
2382
|
|
|
2189
2383
|
// src/runtime/nonce.ts
|
|
2190
2384
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
@@ -2195,11 +2389,12 @@ function transformTag(tag) {
|
|
|
2195
2389
|
exports.Host = Host;
|
|
2196
2390
|
exports.bootstrapLazy = bootstrapLazy;
|
|
2197
2391
|
exports.createEvent = createEvent;
|
|
2392
|
+
exports.getElement = getElement;
|
|
2198
2393
|
exports.globalScripts = globalScripts;
|
|
2199
2394
|
exports.h = h;
|
|
2200
2395
|
exports.promiseResolve = promiseResolve;
|
|
2201
2396
|
exports.registerInstance = registerInstance;
|
|
2202
2397
|
exports.setNonce = setNonce;
|
|
2203
|
-
//# sourceMappingURL=index-
|
|
2398
|
+
//# sourceMappingURL=index-C9Abf0td.js.map
|
|
2204
2399
|
|
|
2205
|
-
//# sourceMappingURL=index-
|
|
2400
|
+
//# sourceMappingURL=index-C9Abf0td.js.map
|