bromcom-ui-next 0.1.3 → 0.1.5
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/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js.map +1 -1
- package/dist/bromcom-ui/global/global.js +14 -15
- package/dist/bromcom-ui/{p-b36f4f44.js → p-12360e4c.js} +1 -1
- package/dist/bromcom-ui/p-15fe392b.js +3 -0
- package/dist/bromcom-ui/p-15fe392b.js.map +1 -0
- package/dist/bromcom-ui/p-2bbd3c52.entry.js +2 -0
- package/dist/bromcom-ui/p-2bbd3c52.entry.js.map +1 -0
- package/dist/bromcom-ui/p-2f1d87a7.entry.js +2 -0
- package/dist/bromcom-ui/p-2f1d87a7.entry.js.map +1 -0
- package/dist/bromcom-ui/p-31354aaa.js +2 -0
- package/dist/bromcom-ui/p-31354aaa.js.map +1 -0
- package/dist/bromcom-ui/p-4f402148.entry.js +2 -0
- package/dist/bromcom-ui/{p-6430a887.entry.js.map → p-4f402148.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-53f21d16.entry.js +2 -0
- package/dist/bromcom-ui/{p-dcc13a55.entry.js.map → p-53f21d16.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-5737e7de.entry.js +2 -0
- package/dist/bromcom-ui/p-5737e7de.entry.js.map +1 -0
- package/dist/bromcom-ui/p-5bee2e76.entry.js +2 -0
- package/dist/bromcom-ui/{p-bde58312.entry.js.map → p-5bee2e76.entry.js.map} +1 -1
- package/dist/bromcom-ui/p-63cb0933.entry.js +2 -0
- package/dist/bromcom-ui/p-63cb0933.entry.js.map +1 -0
- package/dist/bromcom-ui/p-6abaf96f.entry.js +2 -0
- package/dist/bromcom-ui/p-6abaf96f.entry.js.map +1 -0
- package/dist/bromcom-ui/p-729a870f.js +2 -0
- package/dist/bromcom-ui/p-729a870f.js.map +1 -0
- package/dist/bromcom-ui/p-7a1bf6a6.entry.js +2 -0
- package/dist/bromcom-ui/p-7a1bf6a6.entry.js.map +1 -0
- package/dist/bromcom-ui/p-e08b23ff.entry.js +2 -0
- package/dist/bromcom-ui/p-e08b23ff.entry.js.map +1 -0
- package/dist/bromcom-ui/p-f0ece968.entry.js +2 -0
- package/dist/bromcom-ui/p-f0ece968.entry.js.map +1 -0
- package/dist/bromcom-ui/{p-3805363a.entry.js → p-f9eeafa7.entry.js} +2 -2
- package/dist/bromcom-ui/{p-3805363a.entry.js.map → p-f9eeafa7.entry.js.map} +1 -1
- package/dist/bromcom-ui/styles/theme-variables.ts +369 -0
- package/dist/bromcom-ui/styles/themes/index.css +1 -0
- package/dist/bromcom-ui/styles/themes/library/default.css +73 -0
- package/dist/bromcom-ui/styles/variables/box-shadow.css +15 -0
- package/dist/bromcom-ui/styles/variables/colors-dark.css +314 -0
- package/dist/bromcom-ui/styles/variables/colors-light.css +325 -0
- package/dist/bromcom-ui/styles/variables/font-size-rem.css +33 -0
- package/dist/bromcom-ui/styles/variables/font-size.css +33 -0
- package/dist/bromcom-ui/styles/variables/index.css +6 -0
- package/dist/cjs/app-globals-29edfda4.js +39 -0
- package/dist/cjs/app-globals-29edfda4.js.map +1 -0
- package/dist/cjs/bcm-accordion-group.cjs.entry.js +3 -3
- package/dist/cjs/bcm-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +7 -7
- package/dist/cjs/bcm-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-avatar_4.cjs.entry.js +577 -0
- package/dist/cjs/bcm-avatar_4.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-chip.cjs.entry.js +4 -4
- package/dist/cjs/bcm-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-divider.cjs.entry.js +81 -0
- package/dist/cjs/bcm-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-dropdown-item.cjs.entry.js +63 -0
- package/dist/cjs/bcm-dropdown-item.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-dropdown.cjs.entry.js +56 -0
- package/dist/cjs/bcm-dropdown.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-input.cjs.entry.js +313 -0
- package/dist/cjs/bcm-input.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-linked.cjs.entry.js +1981 -0
- package/dist/cjs/bcm-linked.cjs.entry.js.map +1 -0
- package/dist/cjs/bcm-text.cjs.entry.js +4 -4
- package/dist/cjs/bcm-text.cjs.entry.js.map +1 -1
- package/dist/cjs/bcm-textarea.cjs.entry.js +316 -0
- package/dist/cjs/bcm-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{index-c36002ae.js → index-4795c073.js} +13 -4
- package/dist/cjs/index-4795c073.js.map +1 -0
- package/dist/{components/p-b36f4f44.js → cjs/index-5a88e57b.js} +5 -3
- package/dist/cjs/{index-a4eea4bb.js.map → index-5a88e57b.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/validation-messages-c36e5c31.js +134 -0
- package/dist/cjs/validation-messages-c36e5c31.js.map +1 -0
- package/dist/collection/collection-manifest.json +8 -1
- package/dist/collection/components/accordion/accordion.component.js +5 -5
- package/dist/collection/components/accordion/accordion.component.js.map +1 -1
- package/dist/collection/components/accordion/accordion.css +1 -1
- package/dist/collection/components/accordion-group/accordion-group.component.js +1 -1
- package/dist/collection/components/accordion-group/accordion-group.component.js.map +1 -1
- package/dist/collection/components/accordion-group/accordion-group.css +1 -1
- package/dist/collection/components/alert/alert.css +1 -1
- package/dist/collection/components/avatar/avatar.component.js.map +1 -1
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/badge/badge.component.js +373 -0
- package/dist/collection/components/badge/badge.component.js.map +1 -0
- package/dist/collection/components/badge/badge.css +1 -0
- package/dist/collection/components/basic-badge/basic-badge.component.js +236 -0
- package/dist/collection/components/basic-badge/basic-badge.component.js.map +1 -0
- package/dist/collection/components/basic-badge/basic-badge.css +1 -0
- package/dist/collection/components/button/button.component.js +2 -2
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/chip/chip.component.js +2 -2
- package/dist/collection/components/chip/chip.component.js.map +1 -1
- package/dist/collection/components/chip/chip.css +1 -1
- package/dist/collection/components/divider/divider.component.js +190 -0
- package/dist/collection/components/divider/divider.component.js.map +1 -0
- package/dist/collection/components/divider/divider.css +1 -0
- package/dist/collection/components/dropdown/dropdown.component.js +110 -0
- package/dist/collection/components/dropdown/dropdown.component.js.map +1 -0
- package/dist/collection/components/dropdown/dropdown.css +1 -0
- package/dist/collection/components/dropdown-item/dropdown-item.component.js +198 -0
- package/dist/collection/components/dropdown-item/dropdown-item.component.js.map +1 -0
- package/dist/collection/components/dropdown-item/dropdown-item.css +1 -0
- package/dist/collection/components/input/input.component.js +209 -24
- package/dist/collection/components/input/input.component.js.map +1 -1
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/input/types.js +10 -1
- package/dist/collection/components/input/types.js.map +1 -1
- package/dist/collection/components/linked/linked.component.js +140 -0
- package/dist/collection/components/linked/linked.component.js.map +1 -0
- package/dist/collection/components/linked/linked.css +1 -0
- package/dist/collection/components/text/text.component.js +1 -1
- package/dist/collection/components/text/text.css +1 -1
- package/dist/collection/components/textarea/textarea.component.js +1013 -0
- package/dist/collection/components/textarea/textarea.component.js.map +1 -0
- package/dist/collection/components/textarea/textarea.css +2 -0
- package/dist/collection/components/textarea/types.js +2 -0
- package/dist/collection/components/textarea/types.js.map +1 -0
- package/dist/collection/global/global.js +14 -15
- package/dist/collection/styles/theme-variables.js +15 -0
- package/dist/collection/styles/theme-variables.js.map +1 -1
- package/dist/collection/styles/theme-variables.ts +369 -0
- package/dist/collection/styles/themes/index.css +1 -0
- package/dist/collection/styles/themes/library/default.css +73 -0
- package/dist/collection/styles/variables/box-shadow.css +15 -0
- package/dist/collection/styles/variables/colors-dark.css +314 -0
- package/dist/collection/styles/variables/colors-light.css +325 -0
- package/dist/collection/styles/variables/font-size-rem.css +33 -0
- package/dist/collection/styles/variables/font-size.css +33 -0
- package/dist/collection/styles/variables/index.css +6 -0
- package/dist/collection/utils/i18n.js +29 -0
- package/dist/collection/utils/i18n.js.map +1 -0
- package/dist/collection/utils/slot/check-slot-content.js +15 -0
- package/dist/collection/utils/slot/check-slot-content.js.map +1 -0
- package/dist/collection/utils/validation-messages.js +17 -0
- package/dist/collection/utils/validation-messages.js.map +1 -0
- package/dist/components/bcm-accordion-group.js +3 -3
- package/dist/components/bcm-accordion-group.js.map +1 -1
- package/dist/components/bcm-accordion.js +7 -7
- package/dist/components/bcm-accordion.js.map +1 -1
- package/dist/components/bcm-alert.js +2 -2
- package/dist/components/bcm-alert.js.map +1 -1
- package/dist/components/bcm-avatar.js +13 -7
- package/dist/components/bcm-avatar.js.map +1 -1
- package/dist/components/bcm-badge.d.ts +11 -0
- package/dist/components/bcm-badge.js +8 -0
- package/dist/components/bcm-badge.js.map +1 -0
- package/dist/components/bcm-basic-badge.d.ts +11 -0
- package/dist/components/bcm-basic-badge.js +113 -0
- package/dist/components/bcm-basic-badge.js.map +1 -0
- package/dist/components/bcm-button.js +1 -327
- package/dist/components/bcm-button.js.map +1 -1
- package/dist/components/bcm-chip.js +4 -4
- package/dist/components/bcm-chip.js.map +1 -1
- package/dist/components/bcm-divider.d.ts +11 -0
- package/dist/components/bcm-divider.js +100 -0
- package/dist/components/bcm-divider.js.map +1 -0
- package/dist/components/bcm-dropdown-item.d.ts +11 -0
- package/dist/components/bcm-dropdown-item.js +85 -0
- package/dist/components/bcm-dropdown-item.js.map +1 -0
- package/dist/components/bcm-dropdown.d.ts +11 -0
- package/dist/components/bcm-dropdown.js +87 -0
- package/dist/components/bcm-dropdown.js.map +1 -0
- package/dist/components/bcm-input.js +168 -105
- package/dist/components/bcm-input.js.map +1 -1
- package/dist/components/bcm-linked.d.ts +11 -0
- package/dist/components/bcm-linked.js +8 -0
- package/dist/components/bcm-linked.js.map +1 -0
- package/dist/components/bcm-text.js +4 -4
- package/dist/components/bcm-text.js.map +1 -1
- package/dist/components/bcm-textarea.d.ts +11 -0
- package/dist/components/bcm-textarea.js +369 -0
- package/dist/components/bcm-textarea.js.map +1 -0
- package/dist/components/index.js +12 -16
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-0063a3d9.js +331 -0
- package/dist/components/p-0063a3d9.js.map +1 -0
- package/dist/{esm/index-f0e9d579.js → components/p-12360e4c.js} +3 -3
- package/dist/components/{p-b36f4f44.js.map → p-12360e4c.js.map} +1 -1
- package/dist/components/{p-8ded2c73.js → p-13582168.js} +10 -2
- package/dist/components/p-13582168.js.map +1 -0
- package/dist/components/p-31354aaa.js +129 -0
- package/dist/components/p-31354aaa.js.map +1 -0
- package/dist/components/p-613ee92d.js +1997 -0
- package/dist/components/p-613ee92d.js.map +1 -0
- package/dist/components/p-e918f815.js +145 -0
- package/dist/components/p-e918f815.js.map +1 -0
- package/dist/esm/app-globals-bfa07b76.js +37 -0
- package/dist/esm/app-globals-bfa07b76.js.map +1 -0
- package/dist/esm/bcm-accordion-group.entry.js +3 -3
- package/dist/esm/bcm-accordion-group.entry.js.map +1 -1
- package/dist/esm/bcm-accordion.entry.js +7 -7
- package/dist/esm/bcm-accordion.entry.js.map +1 -1
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-alert.entry.js.map +1 -1
- package/dist/esm/bcm-avatar_4.entry.js +570 -0
- package/dist/esm/bcm-avatar_4.entry.js.map +1 -0
- package/dist/esm/bcm-chip.entry.js +4 -4
- package/dist/esm/bcm-chip.entry.js.map +1 -1
- package/dist/esm/bcm-divider.entry.js +77 -0
- package/dist/esm/bcm-divider.entry.js.map +1 -0
- package/dist/esm/bcm-dropdown-item.entry.js +59 -0
- package/dist/esm/bcm-dropdown-item.entry.js.map +1 -0
- package/dist/esm/bcm-dropdown.entry.js +52 -0
- package/dist/esm/bcm-dropdown.entry.js.map +1 -0
- package/dist/esm/bcm-input.entry.js +309 -0
- package/dist/esm/bcm-input.entry.js.map +1 -0
- package/dist/esm/bcm-linked.entry.js +1977 -0
- package/dist/esm/bcm-linked.entry.js.map +1 -0
- package/dist/esm/bcm-text.entry.js +4 -4
- package/dist/esm/bcm-text.entry.js.map +1 -1
- package/dist/esm/bcm-textarea.entry.js +312 -0
- package/dist/esm/bcm-textarea.entry.js.map +1 -0
- package/dist/esm/bromcom-ui.js +4 -4
- package/dist/{cjs/index-a4eea4bb.js → esm/index-097075ad.js} +3 -5
- package/dist/esm/{index-f0e9d579.js.map → index-097075ad.js.map} +1 -1
- package/dist/esm/{index-e23ee9b0.js → index-27cc1bac.js} +13 -4
- package/dist/esm/index-27cc1bac.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/validation-messages-a29d53be.js +129 -0
- package/dist/esm/validation-messages-a29d53be.js.map +1 -0
- package/dist/tailwind.config.js +32 -0
- package/dist/types/components/badge/badge.component.d.ts +87 -0
- package/dist/types/components/basic-badge/basic-badge.component.d.ts +54 -0
- package/dist/types/components/divider/divider.component.d.ts +40 -0
- package/dist/types/components/dropdown/dropdown.component.d.ts +14 -0
- package/dist/types/components/dropdown-item/dropdown-item.component.d.ts +14 -0
- package/dist/types/components/input/input.component.d.ts +19 -0
- package/dist/types/components/input/types.d.ts +10 -0
- package/dist/types/components/linked/linked.component.d.ts +16 -0
- package/dist/types/components/textarea/textarea.component.d.ts +85 -0
- package/dist/types/components/textarea/types.d.ts +7 -0
- package/dist/types/components.d.ts +732 -0
- package/dist/types/styles/theme-variables.d.ts +15 -0
- package/dist/types/utils/i18n.d.ts +8 -0
- package/dist/types/utils/slot/check-slot-content.d.ts +7 -0
- package/dist/types/utils/validation-messages.d.ts +11 -0
- package/package.json +2 -1
- package/dist/bromcom-ui/p-047e562f.entry.js +0 -2
- package/dist/bromcom-ui/p-047e562f.entry.js.map +0 -1
- package/dist/bromcom-ui/p-40643b53.js +0 -2
- package/dist/bromcom-ui/p-40643b53.js.map +0 -1
- package/dist/bromcom-ui/p-61c030c5.js +0 -3
- package/dist/bromcom-ui/p-61c030c5.js.map +0 -1
- package/dist/bromcom-ui/p-6430a887.entry.js +0 -2
- package/dist/bromcom-ui/p-9e94d920.entry.js +0 -2
- package/dist/bromcom-ui/p-9e94d920.entry.js.map +0 -1
- package/dist/bromcom-ui/p-bde58312.entry.js +0 -2
- package/dist/bromcom-ui/p-dcc13a55.entry.js +0 -2
- package/dist/bromcom-ui/p-e7732b0c.entry.js +0 -2
- package/dist/bromcom-ui/p-e7732b0c.entry.js.map +0 -1
- package/dist/cjs/app-globals-e8faea0d.js +0 -43
- package/dist/cjs/app-globals-e8faea0d.js.map +0 -1
- package/dist/cjs/bcm-avatar.cjs.entry.js +0 -89
- package/dist/cjs/bcm-avatar.cjs.entry.js.map +0 -1
- package/dist/cjs/bcm-button_2.cjs.entry.js +0 -549
- package/dist/cjs/bcm-button_2.cjs.entry.js.map +0 -1
- package/dist/cjs/index-c36002ae.js.map +0 -1
- package/dist/components/p-8ded2c73.js.map +0 -1
- package/dist/esm/app-globals-f781c325.js +0 -41
- package/dist/esm/app-globals-f781c325.js.map +0 -1
- package/dist/esm/bcm-avatar.entry.js +0 -85
- package/dist/esm/bcm-avatar.entry.js.map +0 -1
- package/dist/esm/bcm-button_2.entry.js +0 -544
- package/dist/esm/bcm-button_2.entry.js.map +0 -1
- package/dist/esm/index-e23ee9b0.js.map +0 -1
- /package/dist/bromcom-ui/{p-b36f4f44.js.map → p-12360e4c.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bcm-text.js","mappings":";;;AAEO,MAAM,aAAa,GAAiC;IACzD,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,E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AM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhE,QACE,EAAC,GAAG,qDAAC,KAAK,EAAEC,UAAE,CAAC,kCAAkC,EAAE,YAAY,CAAC,EAAE,IAAI,EAAC,MAAM,IAC3E,+DAAO,IAAI,CAAC,IAAI,CAAQ,CACpB,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BcmText","cs"],"sources":["src/components/text/text.utils.ts","src/components/text/text.scss?tag=bcm-text&encapsulation=shadow","src/components/text/text.component.tsx"],"sourcesContent":["import { TextVariant, TextTag } from './text.types';\n\nexport const variantTagMap: Record<TextVariant, TextTag> = {\n display: 'h1',\n heading1: 'h2',\n heading2: 'h3',\n title1: 'h4',\n title2: 'h5',\n title3: 'h6',\n body: 'p',\n bodyAccent: 'p',\n helper: 'p',\n caption: 'p',\n label: 'label',\n placeholder: 'p',\n link: 'a',\n info: 'p',\n infoAccent: 'p',\n};\n","","import { Component, h, Prop } from '@stencil/core';\nimport cs from 'classnames';\nimport { TextVariant, TextSize } from './text.types';\nimport { variantTagMap } from './text.utils';\n\n@Component({\n tag: 'bcm-text',\n styleUrl: 'text.scss',\n shadow: true,\n})\nexport class BcmText {\n /** Text content */\n @Prop()\n text: string;\n\n /** Text variant */\n @Prop()\n variant: TextVariant = 'body';\n\n /** Text size */\n @Prop()\n size: TextSize = 'medium';\n\n private readonly variantClassMap = {\n display: 'font-semibold text-size-12 text-color-header',\n heading1: 'font-semibold text-size-7 text-color-header',\n heading2: 'font-semibold text-size-6 text-color-header',\n title1: {\n small: 'font-semibold text-size-5 text-color-header',\n medium: 'font-semibold text-size-6 text-color-header',\n large: 'font-semibold text-size-7 text-color-header',\n },\n title2: {\n small: 'font-semibold text-size-4 text-color-default',\n medium: 'font-semibold text-size-5 text-color-default',\n large: 'font-semibold text-size-6 text-color-default',\n },\n title3: {\n small: 'font-semibold text-size-3 text-color-disabled',\n medium: 'font-semibold text-size-4 text-color-disabled',\n large: 'font-semibold text-size-5 text-color-disabled',\n },\n body: {\n small: 'font-regular text-size-4 text-color-default',\n medium: 'font-regular text-size-5 text-color-default',\n large: 'font-regular text-size-6 text-color-default',\n },\n bodyAccent: {\n small: 'font-medium text-size-4 text-color-default',\n medium: 'font-medium text-size-5 text-color-default',\n large: 'font-medium text-size-6 text-color-default',\n },\n helper: {\n small: 'font-regular text-size-4 text-color-helper',\n medium: 'font-regular text-size-5 text-color-helper',\n large: 'font-regular text-size-6 text-color-helper',\n },\n caption: {\n small: 'font-regular text-size-3 text-color-caption',\n medium: 'font-regular text-size-4 text-color-caption',\n large: 'font-regular text-size-5 text-color-caption',\n },\n link: {\n small: 'font-medium text-size-4 underline text-color-primary',\n medium: 'font-medium text-size-5 underline text-color-primary',\n large: 'font-medium text-size-6 underline text-color-primary',\n },\n label: {\n small: 'font-medium text-size-3 text-color-label',\n medium: 'font-medium text-size-4 text-color-label',\n large: 'font-medium text-size-5 text-color-label',\n },\n placeholder: {\n small: 'font-regular text-size-4 text-color-placeholder',\n medium: 'font-regular text-size-5 text-color-placeholder',\n large: 'font-regular text-size-6 text-color-placeholder',\n },\n info: {\n small: 'font-regular text-size-3 text-color-default',\n medium: 'font-regular text-size-4 text-color-default',\n large: 'font-regular text-size-5 text-color-default',\n },\n infoAccent: {\n small: 'font-medium text-size-3 text-color-header',\n medium: 'font-medium text-size-4 text-color-header',\n large: 'font-medium text-size-5 text-color-header',\n },\n } as const;\n\n private getTextClass = (variant: TextVariant, size: TextSize): string => {\n const variantClasses = this.variantClassMap[variant];\n\n if (typeof variantClasses === 'string') {\n return variantClasses;\n }\n\n return variantClasses[size];\n };\n\n render() {\n const Tag = variantTagMap[this.variant];\n const variantClass = this.getTextClass(this.variant, this.size);\n\n return (\n <Tag class={cs('bcm-text appearance-none m-0 p-0', variantClass)} part=\"text\">\n <slot>{this.text}</slot>\n </Tag>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface BcmTextarea extends Components.BcmTextarea, HTMLElement {}
|
|
4
|
+
export const BcmTextarea: {
|
|
5
|
+
prototype: BcmTextarea;
|
|
6
|
+
new (): BcmTextarea;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-13582168.js';
|
|
2
|
+
import { c as ce } from './p-5fcf77f9.js';
|
|
3
|
+
import { c as classNames } from './p-12360e4c.js';
|
|
4
|
+
import { g as generateId, s as setValidationMessages, a as getValidationMessage, d as defaultValidationMessages } from './p-31354aaa.js';
|
|
5
|
+
|
|
6
|
+
const textareaCss = ".visible{visibility:visible}.collapse{visibility:collapse}.relative{position:relative}.block{display:block}.flex{display:flex}.table{display:table}.contents{display:contents}.hidden{display:none}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize-none{resize:none;resize:none!important}.resize-y{resize:vertical;resize:vertical!important}.resize-x{resize:horizontal;resize:horizontal!important}.resize{resize:both!important;resize:both}.border{border-width:1px}.underline{text-decoration-line:underline}.outline{outline-style:solid}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid oklch(.928 .006 264.531);box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:oklch(.707 .022 261.325);opacity:1}input::placeholder,textarea::placeholder{color:oklch(.707 .022 261.325);opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{display:block;width:100%}.bcm-textarea__container{display:flex;flex-direction:column;width:100%}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.mt-1{margin-top:.25rem}.min-h-0{min-height:0}.min-h-\\[3rem\\]{min-height:3rem}.min-h-\\[4rem\\]{min-height:4rem}.min-h-\\[5rem\\]{min-height:5rem}.w-full{width:100%}.grow{flex-grow:1}.cursor-not-allowed{cursor:not-allowed}.\\!resize-none{resize:none!important}.\\!resize-y{resize:vertical!important}.\\!resize-x{resize:horizontal!important}.\\!resize{resize:both!important}.appearance-none{appearance:none}.flex-col{flex-direction:column}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.border-0{border-width:0}.border-solid{border-style:solid}.border-\\[--bcm-ui-color-border-default\\]{border-color:var(--bcm-ui-color-border-default)}.border-\\[--bcm-ui-color-border-error\\]{border-color:var(--bcm-ui-color-border-error)}.border-\\[--bcm-ui-color-border-info\\]{border-color:var(--bcm-ui-color-border-info)}.border-\\[--bcm-ui-color-border-success\\]{border-color:var(--bcm-ui-color-border-success)}.border-\\[--bcm-ui-color-border-warning\\]{border-color:var(--bcm-ui-color-border-warning)}.bg-\\[--bcm-ui-color-background-base-default\\]{background-color:var(--bcm-ui-color-background-base-default)}.bg-transparent{background-color:transparent}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.text-right{text-align:right}.font-sans{font-family:Inter,sans-serif}.text-size-3{font-size:var(--bcm-ui-font-size-3,12px);line-height:var(--bcm-ui-line-height-3,16px)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.text-\\[--bcm-ui-color-text-caption\\]{color:var(--bcm-ui-color-text-caption)}.text-\\[--bcm-ui-color-text-default\\]{color:var(--bcm-ui-color-text-default)}.text-\\[--bcm-ui-color-text-disabled\\]{color:var(--bcm-ui-color-text-disabled)}.text-\\[--bcm-ui-color-text-error\\]{color:var(--bcm-ui-color-text-error)}.text-\\[--bcm-ui-color-text-info\\]{color:var(--bcm-ui-color-text-info)}.text-\\[--bcm-ui-color-text-placeholder\\]{color:var(--bcm-ui-color-text-placeholder)}.text-\\[--bcm-ui-color-text-success\\]{color:var(--bcm-ui-color-text-success)}.text-\\[--bcm-ui-color-text-warning\\]{color:var(--bcm-ui-color-text-warning)}.text-color-disabled{color:var(--bcm-ui-color-text-disabled)}.text-color-label{color:var(--bcm-ui-color-text-label)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-50{opacity:.5}.shadow{--tw-shadow:var(--bcm-ui-box-shadow-default);--tw-shadow-colored:var(--bcm-ui-box-shadow-default);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-0{outline-width:0}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-\\[--bcm-ui-color-border-primary\\]{--tw-ring-color:var(--bcm-ui-color-border-primary)}.ring-opacity-50{--tw-ring-opacity:0.5}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.placeholder\\:font-normal::placeholder{font-weight:400}.placeholder\\:text-\\[--bcm-ui-color-text-placeholder\\]::placeholder{color:var(--bcm-ui-color-text-placeholder)}.hover\\:border-\\[--bcm-ui-color-border-error\\]:hover{border-color:var(--bcm-ui-color-border-error)}.hover\\:border-\\[--bcm-ui-color-border-info\\]:hover{border-color:var(--bcm-ui-color-border-info)}.hover\\:border-\\[--bcm-ui-color-border-primary\\]:hover{border-color:var(--bcm-ui-color-border-primary)}.hover\\:border-\\[--bcm-ui-color-border-success\\]:hover{border-color:var(--bcm-ui-color-border-success)}.hover\\:border-\\[--bcm-ui-color-border-warning\\]:hover{border-color:var(--bcm-ui-color-border-warning)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-error\\]:has(:focus){border-color:var(--bcm-ui-color-border-error)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-info\\]:has(:focus){border-color:var(--bcm-ui-color-border-info)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-primary\\]:has(:focus){border-color:var(--bcm-ui-color-border-primary)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-success\\]:has(:focus){border-color:var(--bcm-ui-color-border-success)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-warning\\]:has(:focus){border-color:var(--bcm-ui-color-border-warning)}";
|
|
7
|
+
const BcmTextareaStyle0 = textareaCss;
|
|
8
|
+
|
|
9
|
+
const BcmTextarea$1 = /*@__PURE__*/ proxyCustomElement(class BcmTextarea extends H {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
this.bcmInput = createEvent(this, "bcmInput", 1);
|
|
15
|
+
this.bcmChange = createEvent(this, "bcmChange", 1);
|
|
16
|
+
this.bcmFocus = createEvent(this, "bcmFocus", 1);
|
|
17
|
+
this.bcmBlur = createEvent(this, "bcmBlur", 1);
|
|
18
|
+
this.bcmKeyDown = createEvent(this, "bcmKeyDown", 1);
|
|
19
|
+
this.bcmKeyUp = createEvent(this, "bcmKeyUp", 1);
|
|
20
|
+
this.isFocused = false;
|
|
21
|
+
this.isValid = true;
|
|
22
|
+
this.internalStatus = 'default';
|
|
23
|
+
/** Textarea value */
|
|
24
|
+
this.value = '';
|
|
25
|
+
/** Textarea rows */
|
|
26
|
+
this.rows = 3;
|
|
27
|
+
/** Resize behavior */
|
|
28
|
+
this.resize = 'none';
|
|
29
|
+
/** Auto grow height based on content */
|
|
30
|
+
this.autoGrow = false;
|
|
31
|
+
/** Input id */
|
|
32
|
+
this._id = generateId('textarea');
|
|
33
|
+
/** Controls the textarea size */
|
|
34
|
+
this.size = 'medium';
|
|
35
|
+
/** Defines the textarea's status/state */
|
|
36
|
+
this.status = 'default';
|
|
37
|
+
/** Full width textarea */
|
|
38
|
+
this.fullWidth = false;
|
|
39
|
+
/** Whether the textarea is disabled */
|
|
40
|
+
this.disabled = false;
|
|
41
|
+
/** Whether the textarea is readonly */
|
|
42
|
+
this.readonly = false;
|
|
43
|
+
/** Whether the textarea is required */
|
|
44
|
+
this.required = false;
|
|
45
|
+
/** Show character counter */
|
|
46
|
+
this.showCounter = true;
|
|
47
|
+
this.onChange = (event) => {
|
|
48
|
+
this.bcmChange.emit(event);
|
|
49
|
+
};
|
|
50
|
+
this.onFocus = (event) => {
|
|
51
|
+
this.isFocused = true;
|
|
52
|
+
this.bcmFocus.emit(event);
|
|
53
|
+
};
|
|
54
|
+
this.onBlur = (event) => {
|
|
55
|
+
this.isFocused = false;
|
|
56
|
+
this.bcmBlur.emit(event);
|
|
57
|
+
this.validateInput();
|
|
58
|
+
};
|
|
59
|
+
this.onKeyDown = (event) => {
|
|
60
|
+
this.bcmKeyDown.emit(event);
|
|
61
|
+
};
|
|
62
|
+
this.onKeyUp = (event) => {
|
|
63
|
+
this.bcmKeyUp.emit(event);
|
|
64
|
+
};
|
|
65
|
+
this.styleClass = ce({
|
|
66
|
+
slots: {
|
|
67
|
+
base: [
|
|
68
|
+
'bcm-textarea bcm-textarea__container',
|
|
69
|
+
'bg-[--bcm-ui-color-background-base-default]',
|
|
70
|
+
'border border-solid rounded',
|
|
71
|
+
'flex flex-col', // flex-col ekledik
|
|
72
|
+
'transition-colors duration-200',
|
|
73
|
+
'px-2 py-2',
|
|
74
|
+
'w-full', // w-full ekledik
|
|
75
|
+
],
|
|
76
|
+
textareaClass: [
|
|
77
|
+
'textarea',
|
|
78
|
+
'w-full',
|
|
79
|
+
'border-0 outline-0 bg-transparent',
|
|
80
|
+
'appearance-none',
|
|
81
|
+
'text-[--bcm-ui-color-text-default] placeholder:text-[--bcm-ui-color-text-placeholder] placeholder:font-normal',
|
|
82
|
+
'font-sans antialiased font-medium',
|
|
83
|
+
'px-1',
|
|
84
|
+
'overflow-y-auto', // overflow-y-auto ekledik
|
|
85
|
+
'min-h-0', // min-h-0 ekledik
|
|
86
|
+
],
|
|
87
|
+
counterText: ['textarea-counter-text', 'text-[--bcm-ui-color-text-placeholder]', 'text-right', 'mt-1'],
|
|
88
|
+
},
|
|
89
|
+
variants: {
|
|
90
|
+
size: {
|
|
91
|
+
small: {
|
|
92
|
+
base: '',
|
|
93
|
+
textareaClass: 'text-size-4 min-h-[3rem]',
|
|
94
|
+
counterText: 'text-size-3',
|
|
95
|
+
},
|
|
96
|
+
medium: {
|
|
97
|
+
base: '',
|
|
98
|
+
textareaClass: 'text-size-5 min-h-[4rem]',
|
|
99
|
+
counterText: 'text-size-4',
|
|
100
|
+
},
|
|
101
|
+
large: {
|
|
102
|
+
base: '',
|
|
103
|
+
textareaClass: 'text-size-6 min-h-[5rem]',
|
|
104
|
+
counterText: 'text-size-5',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
resize: {
|
|
108
|
+
none: { textareaClass: '!resize-none' },
|
|
109
|
+
both: { textareaClass: '!resize' },
|
|
110
|
+
horizontal: { textareaClass: '!resize-x' },
|
|
111
|
+
vertical: { textareaClass: '!resize-y' },
|
|
112
|
+
},
|
|
113
|
+
status: {
|
|
114
|
+
default: {
|
|
115
|
+
base: ['border-[--bcm-ui-color-border-default]', 'hover:border-[--bcm-ui-color-border-primary]', 'has-[:focus]:border-[--bcm-ui-color-border-primary]'],
|
|
116
|
+
},
|
|
117
|
+
error: {
|
|
118
|
+
base: ['border-[--bcm-ui-color-border-error]', 'hover:border-[--bcm-ui-color-border-error]', 'has-[:focus]:border-[--bcm-ui-color-border-error]'],
|
|
119
|
+
},
|
|
120
|
+
success: {
|
|
121
|
+
base: ['border-[--bcm-ui-color-border-success]', 'hover:border-[--bcm-ui-color-border-success]', 'has-[:focus]:border-[--bcm-ui-color-border-success]'],
|
|
122
|
+
},
|
|
123
|
+
warning: {
|
|
124
|
+
base: ['border-[--bcm-ui-color-border-warning]', 'hover:border-[--bcm-ui-color-border-warning]', 'has-[:focus]:border-[--bcm-ui-color-border-warning]'],
|
|
125
|
+
},
|
|
126
|
+
info: {
|
|
127
|
+
base: ['border-[--bcm-ui-color-border-info]', 'hover:border-[--bcm-ui-color-border-info]', 'has-[:focus]:border-[--bcm-ui-color-border-info]'],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
fullWidth: {
|
|
131
|
+
true: 'full-width w-full',
|
|
132
|
+
},
|
|
133
|
+
disabled: {
|
|
134
|
+
true: {
|
|
135
|
+
base: 'disabled cursor-not-allowed opacity-50',
|
|
136
|
+
textareaClass: '!resize-none', // disabled durumunda resize'ı engelle
|
|
137
|
+
},
|
|
138
|
+
false: '',
|
|
139
|
+
},
|
|
140
|
+
focused: {
|
|
141
|
+
true: {
|
|
142
|
+
base: 'ring-2 ring-[--bcm-ui-color-border-primary] ring-opacity-50',
|
|
143
|
+
},
|
|
144
|
+
false: '',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
defaultVariants: {
|
|
148
|
+
size: 'medium',
|
|
149
|
+
status: 'default',
|
|
150
|
+
resize: 'vertical',
|
|
151
|
+
fullWidth: false,
|
|
152
|
+
disabled: false,
|
|
153
|
+
focused: false,
|
|
154
|
+
},
|
|
155
|
+
}, {
|
|
156
|
+
twMerge: false,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
handleValueChange(newValue) {
|
|
160
|
+
if (this.textareaRef) {
|
|
161
|
+
this.textareaRef.value = newValue;
|
|
162
|
+
if (this.autoGrow) {
|
|
163
|
+
this.adjustHeight();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
watchStatus(newValue) {
|
|
168
|
+
this.internalStatus = newValue;
|
|
169
|
+
}
|
|
170
|
+
watchErrorMessage(newValue) {
|
|
171
|
+
this.internalErrorMessage = newValue;
|
|
172
|
+
}
|
|
173
|
+
componentWillLoad() {
|
|
174
|
+
setValidationMessages('en', defaultValidationMessages);
|
|
175
|
+
this.internalStatus = this.status;
|
|
176
|
+
this.internalErrorMessage = this.errorMessage;
|
|
177
|
+
}
|
|
178
|
+
componentDidLoad() {
|
|
179
|
+
var _a;
|
|
180
|
+
if (this.autoGrow) {
|
|
181
|
+
this.adjustHeight();
|
|
182
|
+
// Input event'ini dinle
|
|
183
|
+
(_a = this.textareaRef) === null || _a === void 0 ? void 0 : _a.addEventListener('input', () => this.adjustHeight());
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
disconnectedCallback() {
|
|
187
|
+
// Event listener'ı temizle
|
|
188
|
+
if (this.autoGrow && this.textareaRef) {
|
|
189
|
+
this.textareaRef.removeEventListener('input', () => this.adjustHeight());
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async setFocus() {
|
|
193
|
+
var _a;
|
|
194
|
+
(_a = this.textareaRef) === null || _a === void 0 ? void 0 : _a.focus();
|
|
195
|
+
}
|
|
196
|
+
async setBlur() {
|
|
197
|
+
var _a;
|
|
198
|
+
(_a = this.textareaRef) === null || _a === void 0 ? void 0 : _a.blur();
|
|
199
|
+
}
|
|
200
|
+
async select() {
|
|
201
|
+
var _a;
|
|
202
|
+
(_a = this.textareaRef) === null || _a === void 0 ? void 0 : _a.select();
|
|
203
|
+
}
|
|
204
|
+
adjustHeight() {
|
|
205
|
+
if (!this.autoGrow || !this.textareaRef)
|
|
206
|
+
return;
|
|
207
|
+
requestAnimationFrame(() => {
|
|
208
|
+
// Önce height'ı sıfırla ki scrollHeight doğru hesaplansın
|
|
209
|
+
this.textareaRef.style.height = '0px';
|
|
210
|
+
const computedStyle = getComputedStyle(this.textareaRef);
|
|
211
|
+
const lineHeight = parseInt(computedStyle.lineHeight);
|
|
212
|
+
const paddingTop = parseInt(computedStyle.paddingTop);
|
|
213
|
+
const paddingBottom = parseInt(computedStyle.paddingBottom);
|
|
214
|
+
const scrollHeight = this.textareaRef.scrollHeight;
|
|
215
|
+
let newHeight = scrollHeight;
|
|
216
|
+
// Min/max kontrolleri
|
|
217
|
+
if (this.minRows) {
|
|
218
|
+
const minHeight = this.minRows * lineHeight + paddingTop + paddingBottom;
|
|
219
|
+
newHeight = Math.max(newHeight, minHeight);
|
|
220
|
+
}
|
|
221
|
+
if (this.maxRows) {
|
|
222
|
+
const maxHeight = this.maxRows * lineHeight + paddingTop + paddingBottom;
|
|
223
|
+
newHeight = Math.min(newHeight, maxHeight);
|
|
224
|
+
}
|
|
225
|
+
this.textareaRef.style.height = `${newHeight}px`;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
validateInput() {
|
|
229
|
+
if (!this.textareaRef)
|
|
230
|
+
return;
|
|
231
|
+
// Reset validation state
|
|
232
|
+
this.isValid = true;
|
|
233
|
+
this.validationMessage = '';
|
|
234
|
+
const value = this.textareaRef.value;
|
|
235
|
+
// Required check
|
|
236
|
+
if (this.required && !value) {
|
|
237
|
+
this.isValid = false;
|
|
238
|
+
this.validationMessage = getValidationMessage('required');
|
|
239
|
+
this.internalStatus = 'error';
|
|
240
|
+
this.internalErrorMessage = this.validationMessage;
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
// Minimum length check
|
|
244
|
+
if (this.minLength && value.length < this.minLength) {
|
|
245
|
+
this.isValid = false;
|
|
246
|
+
this.validationMessage = getValidationMessage('minlength', { min: this.minLength });
|
|
247
|
+
}
|
|
248
|
+
// Maximum length check
|
|
249
|
+
else if (this.maxLength && value.length > this.maxLength) {
|
|
250
|
+
this.isValid = false;
|
|
251
|
+
this.validationMessage = getValidationMessage('maxlength', { max: this.maxLength });
|
|
252
|
+
}
|
|
253
|
+
// Custom validator
|
|
254
|
+
if (this.validator) {
|
|
255
|
+
const customError = this.validator(value);
|
|
256
|
+
if (customError) {
|
|
257
|
+
this.isValid = false;
|
|
258
|
+
this.validationMessage = customError;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// Update component state
|
|
262
|
+
this.internalStatus = this.isValid ? 'default' : 'error';
|
|
263
|
+
this.internalErrorMessage = this.validationMessage;
|
|
264
|
+
}
|
|
265
|
+
render() {
|
|
266
|
+
const textareaId = this._id + '-textarea' || this.name;
|
|
267
|
+
const { base, textareaClass, counterText } = this.styleClass({
|
|
268
|
+
size: this.size,
|
|
269
|
+
status: this.internalStatus,
|
|
270
|
+
resize: this.resize,
|
|
271
|
+
fullWidth: this.fullWidth,
|
|
272
|
+
disabled: this.disabled,
|
|
273
|
+
focused: this.isFocused,
|
|
274
|
+
});
|
|
275
|
+
return (h("div", { key: '7b05eb283d907f900acf798394397dbedb80ef5a', class: "bcm-ui-element" }, this.label && (h("label", { key: '02b916d542ba581f48a50721342602b1724594ec', class: classNames('textarea-label font-medium', {
|
|
276
|
+
'text-color-label': !this.disabled,
|
|
277
|
+
'text-color-disabled': this.disabled,
|
|
278
|
+
}, {
|
|
279
|
+
'text-size-3': this.size === 'small',
|
|
280
|
+
'text-size-4': this.size === 'medium',
|
|
281
|
+
'text-size-5': this.size === 'large',
|
|
282
|
+
}), htmlFor: textareaId }, h("slot", { key: 'c56433888e76514abc3c1e4dd19e1b8d9206d855', name: "label" }, this.label), this.required && h("span", { key: 'b7faeaa947795adc08c716c9970bb6cdcddef021' }, "*"))), h("div", { key: '24cddef024d6bcd81b444d0ecf619a28349975e0', class: base() }, h("textarea", { key: '09fcd925f11d443be51daf8300bd037d012b33d8', ref: el => (this.textareaRef = el), id: textareaId, class: textareaClass(), name: this.name, rows: this.rows, cols: this.cols, disabled: this.disabled, readonly: this.readonly, required: this.required, placeholder: this.placeholder, minLength: this.minLength, maxLength: this.maxLength, "aria-invalid": this.status === 'error', "aria-required": this.required, "aria-labelledby": this.labelledby, "aria-describedby": this.describedby, value: this.value, onInput: event => {
|
|
283
|
+
const target = event.target;
|
|
284
|
+
this.value = target.value;
|
|
285
|
+
this.bcmInput.emit(event);
|
|
286
|
+
this.validateInput();
|
|
287
|
+
if (this.autoGrow) {
|
|
288
|
+
this.adjustHeight();
|
|
289
|
+
}
|
|
290
|
+
}, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, onKeyUp: this.onKeyUp }), this.showCounter && (h("div", { key: '072155bb06d5556bf5b7315751a80b7f78aedf83', class: counterText() }, this.value.length, this.maxLength ? `/${this.maxLength}` : ''))), (this.captionText || this.internalErrorMessage || this.validationMessage) && (h("div", { key: '458ccb9dea761f5e381fd64fb58323e31e97e0fe', class: classNames('textarea-caption-text font-regular mt-1', {
|
|
291
|
+
'text-[--bcm-ui-color-text-caption]': !this.disabled && this.internalStatus === 'default',
|
|
292
|
+
'text-[--bcm-ui-color-text-error]': !this.disabled && (this.internalStatus === 'error' || !this.isValid),
|
|
293
|
+
'text-[--bcm-ui-color-text-success]': !this.disabled && this.internalStatus === 'success',
|
|
294
|
+
'text-[--bcm-ui-color-text-warning]': !this.disabled && this.internalStatus === 'warning',
|
|
295
|
+
'text-[--bcm-ui-color-text-info]': !this.disabled && this.internalStatus === 'info',
|
|
296
|
+
'text-[--bcm-ui-color-text-disabled]': this.disabled,
|
|
297
|
+
}, {
|
|
298
|
+
'text-size-3': this.size === 'small',
|
|
299
|
+
'text-size-4': this.size === 'medium',
|
|
300
|
+
'text-size-5': this.size === 'large',
|
|
301
|
+
}) }, !this.isValid ? this.validationMessage : this.internalStatus === 'error' ? this.internalErrorMessage : this.captionText))));
|
|
302
|
+
}
|
|
303
|
+
get el() { return this; }
|
|
304
|
+
static get watchers() { return {
|
|
305
|
+
"value": ["handleValueChange"],
|
|
306
|
+
"status": ["watchStatus"],
|
|
307
|
+
"errorMessage": ["watchErrorMessage"]
|
|
308
|
+
}; }
|
|
309
|
+
static get style() { return BcmTextareaStyle0; }
|
|
310
|
+
}, [1, "bcm-textarea", {
|
|
311
|
+
"value": [1537],
|
|
312
|
+
"rows": [2],
|
|
313
|
+
"cols": [2],
|
|
314
|
+
"minRows": [2, "min-rows"],
|
|
315
|
+
"maxRows": [2, "max-rows"],
|
|
316
|
+
"resize": [1],
|
|
317
|
+
"autoGrow": [4, "auto-grow"],
|
|
318
|
+
"placeholder": [1],
|
|
319
|
+
"name": [1],
|
|
320
|
+
"_id": [513, "id"],
|
|
321
|
+
"size": [1],
|
|
322
|
+
"status": [1],
|
|
323
|
+
"fullWidth": [516, "full-width"],
|
|
324
|
+
"disabled": [4],
|
|
325
|
+
"readonly": [4],
|
|
326
|
+
"required": [4],
|
|
327
|
+
"minLength": [2, "min-length"],
|
|
328
|
+
"maxLength": [2, "max-length"],
|
|
329
|
+
"showCounter": [4, "show-counter"],
|
|
330
|
+
"label": [1],
|
|
331
|
+
"errorMessage": [1, "error-message"],
|
|
332
|
+
"captionText": [1, "caption-text"],
|
|
333
|
+
"labelledby": [1],
|
|
334
|
+
"describedby": [1],
|
|
335
|
+
"validator": [16],
|
|
336
|
+
"isFocused": [32],
|
|
337
|
+
"validationMessage": [32],
|
|
338
|
+
"isValid": [32],
|
|
339
|
+
"internalStatus": [32],
|
|
340
|
+
"internalErrorMessage": [32],
|
|
341
|
+
"setFocus": [64],
|
|
342
|
+
"setBlur": [64],
|
|
343
|
+
"select": [64]
|
|
344
|
+
}, undefined, {
|
|
345
|
+
"value": ["handleValueChange"],
|
|
346
|
+
"status": ["watchStatus"],
|
|
347
|
+
"errorMessage": ["watchErrorMessage"]
|
|
348
|
+
}]);
|
|
349
|
+
function defineCustomElement$1() {
|
|
350
|
+
if (typeof customElements === "undefined") {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
const components = ["bcm-textarea"];
|
|
354
|
+
components.forEach(tagName => { switch (tagName) {
|
|
355
|
+
case "bcm-textarea":
|
|
356
|
+
if (!customElements.get(tagName)) {
|
|
357
|
+
customElements.define(tagName, BcmTextarea$1);
|
|
358
|
+
}
|
|
359
|
+
break;
|
|
360
|
+
} });
|
|
361
|
+
}
|
|
362
|
+
defineCustomElement$1();
|
|
363
|
+
|
|
364
|
+
const BcmTextarea = BcmTextarea$1;
|
|
365
|
+
const defineCustomElement = defineCustomElement$1;
|
|
366
|
+
|
|
367
|
+
export { BcmTextarea, defineCustomElement };
|
|
368
|
+
|
|
369
|
+
//# sourceMappingURL=bcm-textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"bcm-textarea.js","mappings":";;;;;AAAA,MAAM,WAAW,GAAG,i0QAAi0Q,CAAC;AACt1Q,0BAAe,WAAW;;MCYbA,aAAW;IALxB;;;;;;;;;;QASW,cAAS,GAAG,KAAK,CAAC;QAElB,YAAO,GAAG,IAAI,CAAC;QACf,mBAAc,GAAgB,SAAS,CAAC;;QAKjD,UAAK,GAAW,EAAE,CAAC;;QAInB,SAAI,GAAY,CAAC,CAAC;;QAgBlB,WAAM,GAAmB,MAAM,CAAC;;QAIhC,aAAQ,GAAG,KAAK,CAAC;;QAYjB,QAAG,GAAY,UAAU,CAAC,UAAU,CAAC,CAAC;;QAItC,SAAI,GAAc,QAAQ,CAAC;;QAI3B,WAAM,GAAgB,SAAS,CAAC;;QAIhC,cAAS,GAAG,KAAK,CAAC;;QAIlB,aAAQ,GAAG,KAAK,CAAC;;QAIjB,aAAQ,GAAG,KAAK,CAAC;;QAIjB,aAAQ,GAAG,KAAK,CAAC;;QAYjB,gBAAW,GAAY,IAAI,CAAC;QAqMpB,aAAQ,G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ACE,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;gBACzF,kCAAkC,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,cAAc,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;gBACxG,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;gBACzF,oCAAoC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;gBACzF,iCAAiC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,KAAK,MAAM;gBACnF,qCAAqC,EAAE,IAAI,CAAC,QAAQ;aACrD,EACD;gBACE,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;gBACpC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;gBACrC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;aACrC,CACF,IAEA,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,cAAc,KAAK,OAAO,GAAG,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,WAAW,CACpH,CACP,CACG,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BcmTextarea","tv"],"sources":["src/components/textarea/textarea.scss?tag=bcm-textarea&encapsulation=shadow","src/components/textarea/textarea.component.tsx"],"sourcesContent":[":host {\n display: block;\n width: 100%;\n}\n\n.bcm-textarea {\n &__container {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n}\n\n// Tailwind'in resize sınıflarını override et\n.resize-none {\n resize: none !important;\n}\n\n.resize {\n resize: both !important;\n}\n\n.resize-y {\n resize: vertical !important;\n}\n\n.resize-x {\n resize: horizontal !important;\n}\n","import { Component, Prop, h, Event, EventEmitter, Method, State, Watch, Element } from '@stencil/core';\nimport { InputSize, InputStatus, TextareaResize } from './types';\nimport { tv } from 'tailwind-variants';\nimport classNames from 'classnames';\nimport { generateId } from '../../utils/id/generate-id';\n// import { checkSlotContent } from '../../utils/slot/check-slot-content';\nimport { getValidationMessage, setValidationMessages, defaultValidationMessages } from '../../utils/validation-messages';\n\n@Component({\n tag: 'bcm-textarea',\n styleUrl: 'textarea.scss',\n shadow: true,\n})\nexport class BcmTextarea {\n @Element() el: HTMLElement;\n private textareaRef: HTMLTextAreaElement;\n\n @State() isFocused = false;\n @State() validationMessage: string;\n @State() isValid = true;\n @State() internalStatus: InputStatus = 'default';\n @State() internalErrorMessage: string;\n\n /** Textarea value */\n @Prop({ mutable: true, reflect: true })\n value: string = '';\n\n /** Textarea rows */\n @Prop()\n rows?: number = 3;\n\n /** Textarea cols */\n @Prop()\n cols?: number;\n\n /** Minimum height in rows */\n @Prop()\n minRows?: number;\n\n /** Maximum height in rows */\n @Prop()\n maxRows?: number;\n\n /** Resize behavior */\n @Prop()\n resize: TextareaResize = 'none';\n\n /** Auto grow height based on content */\n @Prop()\n autoGrow = false;\n\n /** Input placeholder text */\n @Prop()\n placeholder?: string;\n\n /** Input name */\n @Prop()\n name?: string;\n\n /** Input id */\n @Prop({ attribute: 'id', reflect: true })\n _id?: string = generateId('textarea');\n\n /** Controls the textarea size */\n @Prop()\n size: InputSize = 'medium';\n\n /** Defines the textarea's status/state */\n @Prop()\n status: InputStatus = 'default';\n\n /** Full width textarea */\n @Prop({ attribute: 'full-width', reflect: true })\n fullWidth = false;\n\n /** Whether the textarea is disabled */\n @Prop()\n disabled = false;\n\n /** Whether the textarea is readonly */\n @Prop()\n readonly = false;\n\n /** Whether the textarea is required */\n @Prop()\n required = false;\n\n /** Min length for text input */\n @Prop()\n minLength?: number;\n\n /** Max length for text input */\n @Prop()\n maxLength?: number;\n\n /** Show character counter */\n @Prop()\n showCounter: boolean = true;\n\n /** Textarea label for accessibility */\n @Prop()\n label?: string;\n\n /** Error message to display */\n @Prop()\n errorMessage?: string;\n\n /** Caption text to display below textarea */\n @Prop()\n captionText?: string;\n\n /** ID of associated label element */\n @Prop()\n labelledby?: string;\n\n /** ID of associated caption/error text element */\n @Prop()\n describedby?: string;\n\n /** Custom validation function */\n @Prop()\n validator?: (value: string) => string | undefined;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmInput: EventEmitter<InputEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmChange: EventEmitter<Event>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmFocus: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmBlur: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyDown: EventEmitter<KeyboardEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyUp: EventEmitter<KeyboardEvent>;\n\n @Watch('value')\n handleValueChange(newValue: string) {\n if (this.textareaRef) {\n this.textareaRef.value = newValue;\n if (this.autoGrow) {\n this.adjustHeight();\n }\n }\n }\n\n @Watch('status')\n watchStatus(newValue: InputStatus) {\n this.internalStatus = newValue;\n }\n\n @Watch('errorMessage')\n watchErrorMessage(newValue: string) {\n this.internalErrorMessage = newValue;\n }\n\n componentWillLoad() {\n setValidationMessages('en', defaultValidationMessages);\n this.internalStatus = this.status;\n this.internalErrorMessage = this.errorMessage;\n }\n\n componentDidLoad() {\n if (this.autoGrow) {\n this.adjustHeight();\n // Input event'ini dinle\n this.textareaRef?.addEventListener('input', () => this.adjustHeight());\n }\n }\n\n disconnectedCallback() {\n // Event listener'ı temizle\n if (this.autoGrow && this.textareaRef) {\n this.textareaRef.removeEventListener('input', () => this.adjustHeight());\n }\n }\n\n @Method()\n async setFocus() {\n this.textareaRef?.focus();\n }\n\n @Method()\n async setBlur() {\n this.textareaRef?.blur();\n }\n\n @Method()\n async select() {\n this.textareaRef?.select();\n }\n\n private adjustHeight() {\n if (!this.autoGrow || !this.textareaRef) return;\n\n requestAnimationFrame(() => {\n // Önce height'ı sıfırla ki scrollHeight doğru hesaplansın\n this.textareaRef.style.height = '0px';\n\n const computedStyle = getComputedStyle(this.textareaRef);\n const lineHeight = parseInt(computedStyle.lineHeight);\n const paddingTop = parseInt(computedStyle.paddingTop);\n const paddingBottom = parseInt(computedStyle.paddingBottom);\n const scrollHeight = this.textareaRef.scrollHeight;\n\n let newHeight = scrollHeight;\n\n // Min/max kontrolleri\n if (this.minRows) {\n const minHeight = this.minRows * lineHeight + paddingTop + paddingBottom;\n newHeight = Math.max(newHeight, minHeight);\n }\n\n if (this.maxRows) {\n const maxHeight = this.maxRows * lineHeight + paddingTop + paddingBottom;\n newHeight = Math.min(newHeight, maxHeight);\n }\n\n this.textareaRef.style.height = `${newHeight}px`;\n });\n }\n\n private validateInput(): void {\n if (!this.textareaRef) return;\n\n // Reset validation state\n this.isValid = true;\n this.validationMessage = '';\n\n const value = this.textareaRef.value;\n\n // Required check\n if (this.required && !value) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('required');\n this.internalStatus = 'error';\n this.internalErrorMessage = this.validationMessage;\n return;\n }\n\n // Minimum length check\n if (this.minLength && value.length < this.minLength) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('minlength', { min: this.minLength });\n }\n // Maximum length check\n else if (this.maxLength && value.length > this.maxLength) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('maxlength', { max: this.maxLength });\n }\n\n // Custom validator\n if (this.validator) {\n const customError = this.validator(value);\n if (customError) {\n this.isValid = false;\n this.validationMessage = customError;\n }\n }\n\n // Update component state\n this.internalStatus = this.isValid ? 'default' : 'error';\n this.internalErrorMessage = this.validationMessage;\n }\n\n private onChange = (event: Event) => {\n this.bcmChange.emit(event);\n };\n\n private onFocus = (event: FocusEvent) => {\n this.isFocused = true;\n this.bcmFocus.emit(event);\n };\n\n private onBlur = (event: FocusEvent) => {\n this.isFocused = false;\n this.bcmBlur.emit(event);\n this.validateInput();\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n this.bcmKeyDown.emit(event);\n };\n\n private onKeyUp = (event: KeyboardEvent) => {\n this.bcmKeyUp.emit(event);\n };\n\n private styleClass = tv(\n {\n slots: {\n base: [\n 'bcm-textarea bcm-textarea__container',\n 'bg-[--bcm-ui-color-background-base-default]',\n 'border border-solid rounded',\n 'flex flex-col', // flex-col ekledik\n 'transition-colors duration-200',\n 'px-2 py-2',\n 'w-full', // w-full ekledik\n ],\n textareaClass: [\n 'textarea',\n 'w-full',\n 'border-0 outline-0 bg-transparent',\n 'appearance-none',\n 'text-[--bcm-ui-color-text-default] placeholder:text-[--bcm-ui-color-text-placeholder] placeholder:font-normal',\n 'font-sans antialiased font-medium',\n 'px-1',\n 'overflow-y-auto', // overflow-y-auto ekledik\n 'min-h-0', // min-h-0 ekledik\n ],\n counterText: ['textarea-counter-text', 'text-[--bcm-ui-color-text-placeholder]', 'text-right', 'mt-1'],\n },\n variants: {\n size: {\n small: {\n base: '',\n textareaClass: 'text-size-4 min-h-[3rem]',\n counterText: 'text-size-3',\n },\n medium: {\n base: '',\n textareaClass: 'text-size-5 min-h-[4rem]',\n counterText: 'text-size-4',\n },\n large: {\n base: '',\n textareaClass: 'text-size-6 min-h-[5rem]',\n counterText: 'text-size-5',\n },\n },\n resize: {\n none: { textareaClass: '!resize-none' },\n both: { textareaClass: '!resize' },\n horizontal: { textareaClass: '!resize-x' },\n vertical: { textareaClass: '!resize-y' },\n },\n status: {\n default: {\n base: ['border-[--bcm-ui-color-border-default]', 'hover:border-[--bcm-ui-color-border-primary]', 'has-[:focus]:border-[--bcm-ui-color-border-primary]'],\n },\n error: {\n base: ['border-[--bcm-ui-color-border-error]', 'hover:border-[--bcm-ui-color-border-error]', 'has-[:focus]:border-[--bcm-ui-color-border-error]'],\n },\n success: {\n base: ['border-[--bcm-ui-color-border-success]', 'hover:border-[--bcm-ui-color-border-success]', 'has-[:focus]:border-[--bcm-ui-color-border-success]'],\n },\n warning: {\n base: ['border-[--bcm-ui-color-border-warning]', 'hover:border-[--bcm-ui-color-border-warning]', 'has-[:focus]:border-[--bcm-ui-color-border-warning]'],\n },\n info: {\n base: ['border-[--bcm-ui-color-border-info]', 'hover:border-[--bcm-ui-color-border-info]', 'has-[:focus]:border-[--bcm-ui-color-border-info]'],\n },\n },\n fullWidth: {\n true: 'full-width w-full',\n },\n disabled: {\n true: {\n base: 'disabled cursor-not-allowed opacity-50',\n textareaClass: '!resize-none', // disabled durumunda resize'ı engelle\n },\n false: '',\n },\n focused: {\n true: {\n base: 'ring-2 ring-[--bcm-ui-color-border-primary] ring-opacity-50',\n },\n false: '',\n },\n },\n defaultVariants: {\n size: 'medium',\n status: 'default',\n resize: 'vertical',\n fullWidth: false,\n disabled: false,\n focused: false,\n },\n },\n {\n twMerge: false,\n },\n );\n\n render() {\n const textareaId = this._id + '-textarea' || this.name;\n\n const { base, textareaClass, counterText } = this.styleClass({\n size: this.size,\n status: this.internalStatus,\n resize: this.resize,\n fullWidth: this.fullWidth,\n disabled: this.disabled,\n focused: this.isFocused,\n });\n\n return (\n <div class=\"bcm-ui-element\">\n {/* Label rendering */}\n {this.label && (\n <label\n class={classNames(\n 'textarea-label font-medium',\n {\n 'text-color-label': !this.disabled,\n 'text-color-disabled': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n htmlFor={textareaId}\n >\n <slot name=\"label\">{this.label}</slot>\n {this.required && <span>*</span>}\n </label>\n )}\n\n {/* Textarea container */}\n <div class={base()}>\n <textarea\n ref={el => (this.textareaRef = el)}\n id={textareaId}\n class={textareaClass()}\n name={this.name}\n rows={this.rows}\n cols={this.cols}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n placeholder={this.placeholder}\n minLength={this.minLength}\n maxLength={this.maxLength}\n aria-invalid={this.status === 'error'}\n aria-required={this.required}\n aria-labelledby={this.labelledby}\n aria-describedby={this.describedby}\n value={this.value}\n onInput={event => {\n const target = event.target as HTMLTextAreaElement;\n this.value = target.value;\n this.bcmInput.emit(event);\n this.validateInput();\n if (this.autoGrow) {\n this.adjustHeight();\n }\n }}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyDown={this.onKeyDown}\n onKeyUp={this.onKeyUp}\n />\n {/* buraya isteğe bağlı olarak gözüken bir karakter sayacı ekleyeceğiz. bu sayaç sağa yaslı olacak şu formatta olacak 0/120 gibi 0 mevcut karakteri 120 ise limiti gösterecek */}\n {this.showCounter && (\n <div class={counterText()}>\n {this.value.length}\n {this.maxLength ? `/${this.maxLength}` : ''}\n </div>\n )}\n </div>\n\n {/* Validation/Caption message */}\n {(this.captionText || this.internalErrorMessage || this.validationMessage) && (\n <div\n class={classNames(\n 'textarea-caption-text font-regular mt-1',\n {\n 'text-[--bcm-ui-color-text-caption]': !this.disabled && this.internalStatus === 'default',\n 'text-[--bcm-ui-color-text-error]': !this.disabled && (this.internalStatus === 'error' || !this.isValid),\n 'text-[--bcm-ui-color-text-success]': !this.disabled && this.internalStatus === 'success',\n 'text-[--bcm-ui-color-text-warning]': !this.disabled && this.internalStatus === 'warning',\n 'text-[--bcm-ui-color-text-info]': !this.disabled && this.internalStatus === 'info',\n 'text-[--bcm-ui-color-text-disabled]': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n >\n {!this.isValid ? this.validationMessage : this.internalStatus === 'error' ? this.internalErrorMessage : this.captionText}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-
|
|
1
|
+
export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-13582168.js';
|
|
2
2
|
|
|
3
3
|
function addHeadScript(obj) {
|
|
4
4
|
const head = document.head;
|
|
@@ -10,28 +10,24 @@ function addHeadScript(obj) {
|
|
|
10
10
|
}
|
|
11
11
|
addHeadScript({ src: 'https://kit.fontawesome.com/5e86bea963.js', crossOrigin: 'anonymous' });
|
|
12
12
|
const FA_GLOBAL_CSS = 'https://designsystem.bromcomcloud.com/fontawesome/6/css/all.min.css';
|
|
13
|
-
let element = (tag, p = {}) => Object.assign(document.createElement(tag), p);
|
|
14
13
|
customElements.define('bcm-icon', class extends HTMLElement {
|
|
15
14
|
constructor() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
connectedCallback() {
|
|
24
|
-
this.style.display = 'inline-block';
|
|
25
|
-
this.icon = this.icon;
|
|
26
|
-
// this.onclick = evt => this.dispatchEvent(new CustomEvent('click', { bubbles: true, detail: evt }));
|
|
27
|
-
//this.onmouseenter = evt => this.dispatchEvent(new CustomEvent('mouseenter', { bubbles: true, detail: evt }));
|
|
28
|
-
//this.onmouseleave = evt => this.dispatchEvent(new CustomEvent('mouseleave', { bubbles: true, detail: evt }));
|
|
15
|
+
super();
|
|
16
|
+
const shadow = this.attachShadow({ mode: 'open' });
|
|
17
|
+
shadow.innerHTML = `
|
|
18
|
+
<link rel="stylesheet" href="${FA_GLOBAL_CSS}"/>
|
|
19
|
+
<i></i>
|
|
20
|
+
`;
|
|
29
21
|
}
|
|
30
22
|
get icon() {
|
|
31
23
|
return this.getAttribute('name') || this.getAttribute('icon-name');
|
|
32
24
|
}
|
|
33
25
|
set icon(icon) {
|
|
34
|
-
this.shadowRoot.querySelector('
|
|
26
|
+
this.shadowRoot.querySelector('i').className = `${icon}`;
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
this.style.display = 'inline-block';
|
|
30
|
+
this.icon = this.icon;
|
|
35
31
|
}
|
|
36
32
|
});
|
|
37
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.js","mappings":";;AAAA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,IAAI,MAAM,IAAI,GAAG,QAAQ,CAAC;AAC1B,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC;AAC1C,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG;AAChC,QAAQ,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC1B;AACA,IAAI,IAAI,CAAC,WAAW,CAAC;AACrB;;AAEA,MAAM,aAAa,GAAG,qEAAqE,CAAC;;AAE5F,
|
|
1
|
+
{"file":"index.js","mappings":";;AAAA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,IAAI,MAAM,IAAI,GAAG,QAAQ,CAAC;AAC1B,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC;AAC1C,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG;AAChC,QAAQ,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC1B;AACA,IAAI,IAAI,CAAC,WAAW,CAAC;AACrB;;AAEA,MAAM,aAAa,GAAG,qEAAqE,CAAC;;AAE5F,IAAI,WAAW,GAAG;;AAElB,QAAQ,MAAM,MAAM;AACpB,QAAQ;AACR;AACA;AACA,MAAM,CAAC,CAAC;AACR,KAAK;AACL,IAAI,IAAI,IAAI,GAAG;AACf,QAAQ,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;AACjD,KAAK;AACL,IAAI;AACJ;;AAEA,IAAI;AACJ,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,cAAc,CAAC;AAC5C;;AAEA,CAAC,CAAC","names":[],"sources":["src/global/global.js"],"sourcesContent":["function addHeadScript(obj) {\n const head = document.head;\n const script = document.createElement('script');\n Object.keys(obj).forEach(key => {\n script[key] = obj[key];\n });\n head.appendChild(script);\n}\n\naddHeadScript({ src: 'https://kit.fontawesome.com/5e86bea963.js', crossOrigin: 'anonymous' });\n\nconst FA_GLOBAL_CSS = 'https://designsystem.bromcomcloud.com/fontawesome/6/css/all.min.css';\n\ncustomElements.define(\n 'bcm-icon',\n class extends HTMLElement {\n constructor() {\n super();\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.innerHTML = `\n <link rel=\"stylesheet\" href=\"${FA_GLOBAL_CSS}\"/>\n <i></i>\n `;\n }\n\n get icon() {\n return this.getAttribute('name') || this.getAttribute('icon-name');\n }\n\n set icon(icon) {\n this.shadowRoot.querySelector('i').className = `${icon}`;\n }\n\n connectedCallback() {\n this.style.display = 'inline-block';\n this.icon = this.icon;\n }\n },\n);\n"],"version":3}
|