@tmorrow/cre8-wc 1.0.25 → 1.1.1
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/cdn/cre8-wc.esm.js +9082 -15604
- package/cdn/cre8-wc.esm.js.map +1 -1
- package/cdn/cre8-wc.min.js +1231 -8308
- package/cdn/cre8-wc.min.js.map +1 -1
- package/lib/cdn-entry.d.ts +20 -2
- package/lib/cdn-entry.d.ts.map +1 -1
- package/lib/components/accordion/accordion.js +18 -64
- package/lib/components/accordion/accordion.styles.d.ts.map +1 -1
- package/lib/components/accordion-item/accordion-item.js +35 -238
- package/lib/components/accordion-item/accordion-item.styles.d.ts.map +1 -1
- package/lib/components/alert/alert.js +56 -221
- package/lib/components/alert/alert.styles.d.ts.map +1 -1
- package/lib/components/badge/badge.js +33 -164
- package/lib/components/badge/badge.styles.d.ts.map +1 -1
- package/lib/components/band/band.js +15 -46
- package/lib/components/band/band.styles.d.ts.map +1 -1
- package/lib/components/breadcrumbs/breadcrumbs.js +14 -33
- package/lib/components/breadcrumbs/breadcrumbs.styles.d.ts.map +1 -1
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js +10 -45
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.d.ts.map +1 -1
- package/lib/components/button/button.js +16 -16
- package/lib/components/button-group/button-group.js +19 -50
- package/lib/components/button-group/button-group.styles.d.ts.map +1 -1
- package/lib/components/card/card.js +17 -130
- package/lib/components/card/card.styles.d.ts.map +1 -1
- package/lib/components/chart/chart.js +137 -223
- package/lib/components/chart/chart.styles.d.ts.map +1 -1
- package/lib/components/checkbox-field/checkbox-field.js +26 -59
- package/lib/components/checkbox-field/checkbox-field.styles.d.ts.map +1 -1
- package/lib/components/checkbox-field-item/checkbox-field-item.d.ts +0 -5
- package/lib/components/checkbox-field-item/checkbox-field-item.d.ts.map +1 -1
- package/lib/components/checkbox-field-item/checkbox-field-item.js +42 -212
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.d.ts.map +1 -1
- package/lib/components/contexts/form-internals-context.d.ts +30 -0
- package/lib/components/contexts/form-internals-context.d.ts.map +1 -0
- package/lib/components/cre8-form-element.d.ts +98 -24
- package/lib/components/cre8-form-element.d.ts.map +1 -1
- package/lib/components/cre8-form-element.js +221 -22
- package/lib/components/danger-button/danger-button.js +53 -582
- package/lib/components/danger-button/danger-button.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar/calendar.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.d.ts.map +1 -1
- package/lib/components/date-picker/date-picker.js +262 -499
- package/lib/components/date-picker/date-picker.styles.d.ts.map +1 -1
- package/lib/components/divider/divider.js +20 -61
- package/lib/components/divider/divider.styles.d.ts.map +1 -1
- package/lib/components/dropdown/dropdown.js +34 -107
- package/lib/components/dropdown/dropdown.styles.d.ts.map +1 -1
- package/lib/components/dropdown-item/dropdown-item.js +18 -49
- package/lib/components/dropdown-item/dropdown-item.styles.d.ts.map +1 -1
- package/lib/components/feature/feature.js +19 -81
- package/lib/components/feature/feature.styles.d.ts.map +1 -1
- package/lib/components/field/field.js +12 -146
- package/lib/components/field/field.styles.d.ts.map +1 -1
- package/lib/components/field-note/field-note.js +22 -66
- package/lib/components/field-note/field-note.styles.d.ts.map +1 -1
- package/lib/components/footer/footer.js +10 -29
- package/lib/components/footer/footer.styles.d.ts.map +1 -1
- package/lib/components/global-nav/global-nav.js +20 -43
- package/lib/components/global-nav/global-nav.styles.d.ts.map +1 -1
- package/lib/components/global-nav-item/global-nav-item.js +26 -105
- package/lib/components/global-nav-item/global-nav-item.styles.d.ts.map +1 -1
- package/lib/components/grid/grid.js +15 -337
- package/lib/components/grid/grid.styles.d.ts.map +1 -1
- package/lib/components/grid-item/grid-item.js +7 -15
- package/lib/components/grid-item/grid-item.styles.d.ts.map +1 -1
- package/lib/components/header/header.js +17 -80
- package/lib/components/header/header.styles.d.ts.map +1 -1
- package/lib/components/heading/heading.js +16 -153
- package/lib/components/heading/heading.styles.d.ts.map +1 -1
- package/lib/components/hero/hero.js +17 -149
- package/lib/components/hero/hero.styles.d.ts.map +1 -1
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon.styles.d.ts.map +1 -1
- package/lib/components/inline-alert/inline-alert.js +53 -214
- package/lib/components/inline-alert/inline-alert.styles.d.ts.map +1 -1
- package/lib/components/layout/layout.js +20 -53
- package/lib/components/layout/layout.styles.d.ts.map +1 -1
- package/lib/components/layout-container/layout-container.js +20 -43
- package/lib/components/layout-container/layout-container.styles.d.ts.map +1 -1
- package/lib/components/layout-section/layout-section.js +20 -29
- package/lib/components/layout-section/layout-section.styles.d.ts.map +1 -1
- package/lib/components/linelength-container/linelength-container.js +7 -15
- package/lib/components/linelength-container/linelength-container.styles.d.ts.map +1 -1
- package/lib/components/link/link.js +33 -228
- package/lib/components/link/link.styles.d.ts.map +1 -1
- package/lib/components/link-list/link-list.js +23 -129
- package/lib/components/link-list/link-list.styles.d.ts.map +1 -1
- package/lib/components/link-list-item/link-list-item.js +19 -80
- package/lib/components/link-list-item/link-list-item.styles.d.ts.map +1 -1
- package/lib/components/list/list.js +17 -67
- package/lib/components/list/list.styles.d.ts.map +1 -1
- package/lib/components/list-item/list-item.js +11 -16
- package/lib/components/list-item/list-item.styles.d.ts.map +1 -1
- package/lib/components/loading-spinner/loading-spinner.js +13 -157
- package/lib/components/loading-spinner/loading-spinner.styles.d.ts.map +1 -1
- package/lib/components/logo/logo.js +20 -30
- package/lib/components/logo/logo.styles.d.ts.map +1 -1
- package/lib/components/main/main.js +18 -42
- package/lib/components/main/main.styles.d.ts.map +1 -1
- package/lib/components/modal/modal.js +50 -215
- package/lib/components/modal/modal.styles.d.ts.map +1 -1
- package/lib/components/multi-select/multi-select.js +57 -222
- package/lib/components/multi-select/multi-select.styles.d.ts.map +1 -1
- package/lib/components/nav-container/nav-container.js +5 -40
- package/lib/components/nav-container/nav-container.styles.d.ts.map +1 -1
- package/lib/components/page-header/page-header.js +19 -54
- package/lib/components/page-header/page-header.styles.d.ts.map +1 -1
- package/lib/components/pagination/page-counter/page-counter.styles.d.ts.map +1 -1
- package/lib/components/pagination/pagination.js +102 -183
- package/lib/components/pagination/pagination.styles.d.ts.map +1 -1
- package/lib/components/percent-bar/percent-bar.js +22 -50
- package/lib/components/percent-bar/percent-bar.styles.d.ts.map +1 -1
- package/lib/components/popover/popover.js +51 -220
- package/lib/components/popover/popover.styles.d.ts.map +1 -1
- package/lib/components/primary-nav/primary-nav.js +17 -51
- package/lib/components/primary-nav/primary-nav.styles.d.ts.map +1 -1
- package/lib/components/primary-nav-item/primary-nav-item.js +24 -191
- package/lib/components/primary-nav-item/primary-nav-item.styles.d.ts.map +1 -1
- package/lib/components/progress-meter/progress-meter.js +23 -127
- package/lib/components/progress-meter/progress-meter.styles.d.ts.map +1 -1
- package/lib/components/progress-steps/progress-steps.styles.d.ts.map +1 -1
- package/lib/components/progress-steps-item/progress-steps-item.js +27 -118
- package/lib/components/progress-steps-item/progress-steps-item.styles.d.ts.map +1 -1
- package/lib/components/radio-field/radio-field.js +28 -64
- package/lib/components/radio-field/radio-field.styles.d.ts.map +1 -1
- package/lib/components/radio-field-item/radio-field-item.d.ts +0 -4
- package/lib/components/radio-field-item/radio-field-item.d.ts.map +1 -1
- package/lib/components/radio-field-item/radio-field-item.js +69 -207
- package/lib/components/radio-field-item/radio-field-item.styles.d.ts.map +1 -1
- package/lib/components/remove-tag/remove-tag.js +36 -129
- package/lib/components/remove-tag/remove-tag.styles.d.ts.map +1 -1
- package/lib/components/section/section.js +19 -50
- package/lib/components/section/section.styles.d.ts.map +1 -1
- package/lib/components/select/select.d.ts +6 -10
- package/lib/components/select/select.d.ts.map +1 -1
- package/lib/components/select/select.js +67 -135
- package/lib/components/select/select.styles.d.ts.map +1 -1
- package/lib/components/select-tile/select-tile.d.ts +0 -4
- package/lib/components/select-tile/select-tile.d.ts.map +1 -1
- package/lib/components/select-tile/select-tile.js +21 -448
- package/lib/components/select-tile/select-tile.styles.d.ts.map +1 -1
- package/lib/components/select-tile-list/select-tile-list.js +24 -62
- package/lib/components/select-tile-list/select-tile-list.styles.d.ts.map +1 -1
- package/lib/components/skeleton-loader/skeleton-loader.js +19 -73
- package/lib/components/skeleton-loader/skeleton-loader.styles.d.ts.map +1 -1
- package/lib/components/split-button/split-button.js +21 -37
- package/lib/components/split-button/split-button.styles.d.ts.map +1 -1
- package/lib/components/submenu/submenu.js +8 -18
- package/lib/components/submenu/submenu.styles.d.ts.map +1 -1
- package/lib/components/submenu-item/submenu-item.js +21 -42
- package/lib/components/submenu-item/submenu-item.styles.d.ts.map +1 -1
- package/lib/components/tab/tab.js +17 -100
- package/lib/components/tab/tab.styles.d.ts.map +1 -1
- package/lib/components/tab-panel/tab-panel.js +18 -52
- package/lib/components/tab-panel/tab-panel.styles.d.ts.map +1 -1
- package/lib/components/table/table.js +21 -73
- package/lib/components/table/table.styles.d.ts.map +1 -1
- package/lib/components/table-body/table-body.js +12 -24
- package/lib/components/table-body/table-body.styles.d.ts.map +1 -1
- package/lib/components/table-cell/table-cell.js +29 -69
- package/lib/components/table-cell/table-cell.styles.d.ts.map +1 -1
- package/lib/components/table-header/table-header.js +8 -39
- package/lib/components/table-header/table-header.styles.d.ts.map +1 -1
- package/lib/components/table-header-cell/table-header-cell.js +18 -37
- package/lib/components/table-header-cell/table-header-cell.styles.d.ts.map +1 -1
- package/lib/components/table-object/table-object.js +13 -32
- package/lib/components/table-object/table-object.styles.d.ts.map +1 -1
- package/lib/components/table-row/table-row.js +33 -139
- package/lib/components/table-row/table-row.styles.d.ts.map +1 -1
- package/lib/components/tabs/tabs.d.ts.map +1 -1
- package/lib/components/tabs/tabs.js +58 -159
- package/lib/components/tabs/tabs.styles.d.ts.map +1 -1
- package/lib/components/tag/tag.js +46 -161
- package/lib/components/tag/tag.styles.d.ts.map +1 -1
- package/lib/components/tag-list/tag-list.js +20 -51
- package/lib/components/tag-list/tag-list.styles.d.ts.map +1 -1
- package/lib/components/tertiary-nav/tertiary-nav.js +21 -54
- package/lib/components/tertiary-nav/tertiary-nav.styles.d.ts.map +1 -1
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js +18 -68
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.d.ts.map +1 -1
- package/lib/components/text-link/text-link.js +20 -85
- package/lib/components/text-link/text-link.styles.d.ts.map +1 -1
- package/lib/components/text-passage/text-passage-light-dom.styles.d.ts.map +1 -1
- package/lib/components/text-passage/text-passage.js +17 -189
- package/lib/components/text-passage/text-passage.styles.d.ts.map +1 -1
- package/lib/components/tooltip/tooltip.js +57 -248
- package/lib/components/tooltip/tooltip.styles.d.ts.map +1 -1
- package/lib/components/utility-nav/utility-nav.js +23 -56
- package/lib/components/utility-nav/utility-nav.styles.d.ts.map +1 -1
- package/lib/components/utility-nav-item/utility-nav-item.js +28 -83
- package/lib/components/utility-nav-item/utility-nav-item.styles.d.ts.map +1 -1
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.d.ts.map +1 -1
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.d.ts +3 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.d.ts.map +1 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.d.ts +2 -2
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.d.ts.map +1 -1
- package/lib/design-tokens/core/scss/theming/component.scss +6 -6
- package/lib/design-tokens/core/scss/theming/functions.scss +4 -0
- package/lib/design-tokens/core/scss/theming/spacing.scss +60 -60
- package/lib/design-tokens/core/scss/theming/variables.scss +11 -11
- package/lib/design-tokens/mixins/typography-usage.scss +277 -277
- package/lib/design-tokens/tokens_netflix.theme.d.ts.map +1 -1
- package/lib/{icon-DImqxDiW.js → icon-D22g8aWB.js} +35 -138
- package/lib/index.js +1 -1
- package/package.json +12 -5
|
@@ -85,11 +85,6 @@ export declare class Cre8CheckboxFieldItem extends Cre8FormElement {
|
|
|
85
85
|
* Additional aria-describedby connection to id for additional success and error notes to be accessible
|
|
86
86
|
*/
|
|
87
87
|
validationAriaDescribedBy?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Checkbox name
|
|
90
|
-
* @attr {string}
|
|
91
|
-
*/
|
|
92
|
-
name?: string;
|
|
93
88
|
/**
|
|
94
89
|
* Required property
|
|
95
90
|
* @attr {boolean}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-field-item.d.ts","sourceRoot":"","sources":["../../../components/checkbox-field-item/checkbox-field-item.ts"],"names":[],"mappings":"AAIA,OAAO,cAAc,CAAC;AACtB,OAAO,0BAA0B,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,qBAAsB,SAAQ,eAAe;IACtD,QAAQ,CAAC,IAAI,cAAc;IAE3B,MAAM,CAAC,MAAM,4BAAY;
|
|
1
|
+
{"version":3,"file":"checkbox-field-item.d.ts","sourceRoot":"","sources":["../../../components/checkbox-field-item/checkbox-field-item.ts"],"names":[],"mappings":"AAIA,OAAO,cAAc,CAAC;AACtB,OAAO,0BAA0B,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,qBAAsB,SAAQ,eAAe;IACtD,QAAQ,CAAC,IAAI,cAAc;IAE3B,MAAM,CAAC,MAAM,4BAAY;IAEzB;;OAEG;IAEH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IAEH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IAEH,SAAS,EAAE,MAAM,CAAW;IAE5B;;OAEG;IAEH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IAEH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IAEH,WAAW,EAAE,MAAM,CAAa;IAEhC;;OAEG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IAEH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IAEH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IAEH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IAEH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IAEH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IAEH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAInC;;;OAGG;IAEH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IAEH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IAEH,KAAK,EAAG,gBAAgB,CAAC;IAEzB,UAAmB,YAAY,EAAE,OAAO,CAAC;IAEzC;;;;;;;MAOE;IAEF,iBAAiB;IAMjB;;OAEG;IACH,OAAO,CAAC,OAAO;IAQf;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAInB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAKrB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAkBvB;;;;;;OAMG;IACH,iBAAiB,IAAI,IAAI;IAOzB;;;OAGG;IACH,YAAY;IAKZ;;OAEG;IACH,cAAc;IAUd;;;;;;;OAOG;IACH,aAAa,IAAI,MAAM;IASvB;;;;OAIG;IACH,2BAA2B;IA0B3B,MAAM;CAqCT;AAMD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,0BAA0B,EAAE,qBAAqB,CAAC;KACrD;CACJ;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,184 +1,17 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as f, html as a, nothing as b } from "lit";
|
|
2
2
|
import { ifDefined as o } from "lit-html/directives/if-defined.js";
|
|
3
|
-
import { property as
|
|
4
|
-
import { nanoid as
|
|
5
|
-
import { s as
|
|
3
|
+
import { property as r, query as u } from "lit/decorators.js";
|
|
4
|
+
import { nanoid as d } from "nanoid";
|
|
5
|
+
import { s as x } from "../../icon-D22g8aWB.js";
|
|
6
6
|
import "../field-note/field-note.js";
|
|
7
|
-
import { Cre8FormElement as
|
|
8
|
-
const y =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
#CHECKBOX-FIELD-ITEM
|
|
14
|
-
\*------------------------------------*/
|
|
15
|
-
|
|
16
|
-
:host {
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
flex-wrap: wrap;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 1) Form field that is composed of a checkbox input, label, and an optional field note.
|
|
23
|
-
*/
|
|
24
|
-
.cre8-c-checkbox-field-item {
|
|
25
|
-
display: flex;
|
|
26
|
-
position: relative;
|
|
27
|
-
align-items: center;
|
|
28
|
-
margin-bottom: calc(8px * 1);
|
|
29
|
-
min-height: calc(8px * 3);
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Checkbox field item within last cre8-checkbox-field-item wrapper in a fieldset
|
|
33
|
-
* 1) Remove margin bottom on last item
|
|
34
|
-
*/
|
|
35
|
-
:host(:last-child) & {
|
|
36
|
-
margin-bottom: 0; /* 1 */
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Checkbox field item input
|
|
42
|
-
*/
|
|
43
|
-
.cre8-c-checkbox-field-item__input {
|
|
44
|
-
opacity: 0;
|
|
45
|
-
cursor: pointer;
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: 0;
|
|
48
|
-
left: 0;
|
|
49
|
-
height: calc(8px * 3);
|
|
50
|
-
min-width: calc(8px * 3);
|
|
51
|
-
margin: 0;
|
|
52
|
-
z-index: 1;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Checkbox field item input error
|
|
56
|
-
*/
|
|
57
|
-
.cre8-c-checkbox-field-item--disabled & {
|
|
58
|
-
cursor: not-allowed;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Checkbox field item custom checkbox container
|
|
64
|
-
*/
|
|
65
|
-
.cre8-c-checkbox-field-item__custom-checkbox {
|
|
66
|
-
display: flex;
|
|
67
|
-
position: absolute;
|
|
68
|
-
top: 0;
|
|
69
|
-
left: 0;
|
|
70
|
-
height: calc(8px * 3);
|
|
71
|
-
width: calc(8px * 3);
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
align-items: center;
|
|
74
|
-
justify-content: center;
|
|
75
|
-
border-radius: var(--cre8-border-radius-small);
|
|
76
|
-
border-width: var(--cre8-border-width-default);
|
|
77
|
-
border-style: var(--cre8-border-style-default);
|
|
78
|
-
background-color: var(--cre8-color-bg-default);
|
|
79
|
-
border-color: var(--cre8-color-border-strong);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Checkbox field item custom checkbox focus visible custom outline
|
|
83
|
-
*/
|
|
84
|
-
.cre8-c-checkbox-field-item__input:focus-visible + & {
|
|
85
|
-
@include focus;
|
|
86
|
-
|
|
87
|
-
.cre8-c-checkbox-field-item--error & {
|
|
88
|
-
@include focusError;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Checkbox field item custom checkbox within checkbox field with error
|
|
94
|
-
*/
|
|
95
|
-
.cre8-c-checkbox-field-item--error & {
|
|
96
|
-
background-color: var(--cre8-color-bg-default);
|
|
97
|
-
border-color: var(--cre8-color-border-error);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Checkbox field item custom checkbox within checkbox field with disabled
|
|
102
|
-
*/
|
|
103
|
-
.cre8-c-checkbox-field-item--disabled & {
|
|
104
|
-
cursor: not-allowed;
|
|
105
|
-
background-color: var(--cre8-color-bg-disabled);
|
|
106
|
-
border-color: var(--cre8-color-border-disabled);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Checkbox field item custom checkbox when item is checked
|
|
112
|
-
*/
|
|
113
|
-
.cre8-c-checkbox-field-item__input:checked + .cre8-c-checkbox-field-item__custom-checkbox {
|
|
114
|
-
background-color: var(--cre8-color-bg-brand-strong);
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Checkbox field item custom checkbox when item is checked with error
|
|
118
|
-
*/
|
|
119
|
-
.cre8-c-checkbox-field-item--error & {
|
|
120
|
-
background-color: var(--cre8-color-bg-default);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Checkbox field item custom checkbox when item is checked with disabled
|
|
125
|
-
*/
|
|
126
|
-
.cre8-c-checkbox-field-item--disabled & {
|
|
127
|
-
background-color: var(--cre8-color-bg-disabled);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Checkbox field item checkmark icon
|
|
133
|
-
*/
|
|
134
|
-
.cre8-c-checkbox-field-item__icon {
|
|
135
|
-
display: none;
|
|
136
|
-
color: var(--cre8-color-content-knockout);
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Checkbox field item icon within checkbox field with error
|
|
140
|
-
*/
|
|
141
|
-
.cre8-c-checkbox-field-item--error & {
|
|
142
|
-
color: var(--cre8-color-content-error);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Checkbox field item icon within checkbox field disabled
|
|
147
|
-
*/
|
|
148
|
-
.cre8-c-checkbox-field-item--disabled & {
|
|
149
|
-
color: var(--cre8-color-content-disabled);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Checkbox field item icon will display in the box if the input is checked
|
|
154
|
-
*/
|
|
155
|
-
.cre8-c-checkbox-field-item__input:checked + .cre8-c-checkbox-field-item__custom-checkbox & {
|
|
156
|
-
display: flex;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Checkbox field item input
|
|
162
|
-
*/
|
|
163
|
-
.cre8-c-checkbox-field-item__label {
|
|
164
|
-
margin-left: calc(8px * 4);
|
|
165
|
-
@include cre8-typography-label-small;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Checkbox field item field notes
|
|
170
|
-
*/
|
|
171
|
-
.cre8-c-checkbox-field-item__field-note,
|
|
172
|
-
.cre8-c-checkbox-field-item__field-note-success,
|
|
173
|
-
.cre8-c-checkbox-field-item__field-note-error {
|
|
174
|
-
flex-basis: 100%;
|
|
175
|
-
}`;
|
|
176
|
-
var v = Object.defineProperty, i = (n, t, s, b) => {
|
|
177
|
-
for (var r = void 0, d = n.length - 1, f; d >= 0; d--)
|
|
178
|
-
(f = n[d]) && (r = f(t, s, r) || r);
|
|
179
|
-
return r && v(t, s, r), r;
|
|
7
|
+
import { Cre8FormElement as k } from "../cre8-form-element.js";
|
|
8
|
+
const y = f`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}.cre8-u-is-hidden{display:none !important;visibility:hidden !important}.cre8-u-is-vishidden{position:absolute !important;overflow:hidden;width:1px;height:1px;padding:0;border:0;clip:rect(1px, 1px, 1px, 1px)}@media all and (min-width: 23.4375rem){.cre8-u-hide-sm{display:none !important}}@media all and (min-width: 35rem){.cre8-u-hide-sm-2{display:none !important}}@media all and (min-width: 48rem){.cre8-u-hide-md{display:none !important}}@media all and (min-width: 60rem){.cre8-u-hide-lg{display:none !important}}@media all and (min-width: 75rem){.cre8-u-hide-xl{display:none !important}}@media all and (max-width: 23.4375rem){.cre8-u-show-sm{display:none !important}}@media all and (max-width: 35rem){.cre8-u-show-sm-2{display:none !important}}@media all and (max-width: 48rem){.cre8-u-show-md{display:none !important}}@media all and (max-width: 60rem){.cre8-u-show-lg{display:none !important}}@media all and (max-width: 75rem){.cre8-u-show-xl{display:none !important}}:host{display:inline-flex;flex-wrap:wrap}.cre8-c-checkbox-field-item{display:flex;position:relative;align-items:center;margin-bottom:0.5rem;min-height:1.5rem}:host(:last-child) .cre8-c-checkbox-field-item{margin-bottom:0}.cre8-c-checkbox-field-item__input{opacity:0;cursor:pointer;position:absolute;top:0;left:0;height:1.5rem;min-width:1.5rem;margin:0;z-index:1}.cre8-c-checkbox-field-item--disabled .cre8-c-checkbox-field-item__input{cursor:not-allowed}.cre8-c-checkbox-field-item__custom-checkbox{display:flex;position:absolute;top:0;left:0;height:1.5rem;width:1.5rem;cursor:pointer;align-items:center;justify-content:center;border-radius:var(--cre8-border-radius-small);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default);background-color:var(--cre8-color-bg-default);border-color:var(--cre8-color-border-strong)}.cre8-c-checkbox-field-item__input:focus-visible+.cre8-c-checkbox-field-item__custom-checkbox{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-c-checkbox-field-item--error .cre8-c-checkbox-field-item__input:focus-visible+.cre8-c-checkbox-field-item__custom-checkbox{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-error);outline-offset:0.125rem}.cre8-c-checkbox-field-item--error .cre8-c-checkbox-field-item__custom-checkbox{background-color:var(--cre8-color-bg-default);border-color:var(--cre8-color-border-error)}.cre8-c-checkbox-field-item--disabled .cre8-c-checkbox-field-item__custom-checkbox{cursor:not-allowed;background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled)}.cre8-c-checkbox-field-item__input:checked+.cre8-c-checkbox-field-item__custom-checkbox{background-color:var(--cre8-color-bg-brand-strong)}.cre8-c-checkbox-field-item--error .cre8-c-checkbox-field-item__input:checked+.cre8-c-checkbox-field-item__custom-checkbox{background-color:var(--cre8-color-bg-default)}.cre8-c-checkbox-field-item--disabled .cre8-c-checkbox-field-item__input:checked+.cre8-c-checkbox-field-item__custom-checkbox{background-color:var(--cre8-color-bg-disabled)}.cre8-c-checkbox-field-item__icon{display:none;color:var(--cre8-color-content-knockout)}.cre8-c-checkbox-field-item--error .cre8-c-checkbox-field-item__icon{color:var(--cre8-color-content-error)}.cre8-c-checkbox-field-item--disabled .cre8-c-checkbox-field-item__icon{color:var(--cre8-color-content-disabled)}.cre8-c-checkbox-field-item__input:checked+.cre8-c-checkbox-field-item__custom-checkbox .cre8-c-checkbox-field-item__icon{display:flex}.cre8-c-checkbox-field-item__label{margin-left:2rem;font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform)}.cre8-c-checkbox-field-item__field-note,.cre8-c-checkbox-field-item__field-note-success,.cre8-c-checkbox-field-item__field-note-error{flex-basis:100%}`;
|
|
9
|
+
var g = Object.defineProperty, i = (h, t, s, m) => {
|
|
10
|
+
for (var c = void 0, l = h.length - 1, p; l >= 0; l--)
|
|
11
|
+
(p = h[l]) && (c = p(t, s, c) || c);
|
|
12
|
+
return c && g(t, s, c), c;
|
|
180
13
|
};
|
|
181
|
-
const
|
|
14
|
+
const n = class n extends k {
|
|
182
15
|
constructor() {
|
|
183
16
|
super(...arguments), this.type = "checkbox", this.errorText = "Error", this.successText = "Success";
|
|
184
17
|
}
|
|
@@ -205,14 +38,14 @@ const h = class h extends x {
|
|
|
205
38
|
* Otherwise, don't provide a value for the checkbox data array
|
|
206
39
|
*/
|
|
207
40
|
setFormData() {
|
|
208
|
-
return this.checked ? this.
|
|
41
|
+
return this.checked ? this._internals.setFormValue(this.value || "on") : this._internals.setFormValue(null);
|
|
209
42
|
}
|
|
210
43
|
/**
|
|
211
44
|
* Handle on checkbox change
|
|
212
45
|
* 1) On change of the checkbox input, if `checked` is true, then set it to false and vice versa.
|
|
213
46
|
*/
|
|
214
47
|
_clickHandler() {
|
|
215
|
-
return this.checked = !this.checked, this.checked ? this.
|
|
48
|
+
return this.checked = !this.checked, this.checked ? this._internals.setFormValue(this.value || "on") : this._internals.setFormValue(null);
|
|
216
49
|
}
|
|
217
50
|
/**
|
|
218
51
|
* Handle On Change
|
|
@@ -221,8 +54,8 @@ const h = class h extends x {
|
|
|
221
54
|
*/
|
|
222
55
|
_handleOnChange(t) {
|
|
223
56
|
const s = t.target;
|
|
224
|
-
this.value = s.value, this.
|
|
225
|
-
const
|
|
57
|
+
this.value = s.value, this._internals.setFormValue(this.value);
|
|
58
|
+
const m = new CustomEvent("change", {
|
|
226
59
|
detail: {
|
|
227
60
|
name: this.name,
|
|
228
61
|
value: this.value
|
|
@@ -230,7 +63,7 @@ const h = class h extends x {
|
|
|
230
63
|
bubbles: !0,
|
|
231
64
|
composed: !0
|
|
232
65
|
});
|
|
233
|
-
this.dispatchEvent(
|
|
66
|
+
this.dispatchEvent(m);
|
|
234
67
|
}
|
|
235
68
|
/**
|
|
236
69
|
* Form reset callback
|
|
@@ -253,7 +86,7 @@ const h = class h extends x {
|
|
|
253
86
|
* Initialize aria attributes
|
|
254
87
|
*/
|
|
255
88
|
initializeAria() {
|
|
256
|
-
this.fieldId = this.fieldId ||
|
|
89
|
+
this.fieldId = this.fieldId || d(), (this.fieldNote || this.slotNotEmpty("fieldNote")) && (this.ariaDescribedBy = this.ariaDescribedBy || d()), (this.successNote || this.errorNote) && (this.validationAriaDescribedBy = this.validationAriaDescribedBy || d());
|
|
257
90
|
}
|
|
258
91
|
/**
|
|
259
92
|
* Aria describedby string based on field notes and error/success notes
|
|
@@ -272,14 +105,14 @@ const h = class h extends x {
|
|
|
272
105
|
* 2. If there is a errorNote, then return the field note with the error message and state.
|
|
273
106
|
*/
|
|
274
107
|
renderSuccessErrorFieldNote() {
|
|
275
|
-
return this.successNote ?
|
|
108
|
+
return this.successNote ? a`<cre8-field-note
|
|
276
109
|
?isSuccess=${this.isSuccess}
|
|
277
110
|
id=${this.validationAriaDescribedBy}
|
|
278
111
|
class="cre8-c-checkbox-field-item__field-note-success"
|
|
279
112
|
iconName="success"
|
|
280
113
|
>
|
|
281
114
|
<span class="cre8-u-is-vishidden">${this.successText}</span> ${this.successNote}
|
|
282
|
-
</cre8-field-note>` : this.errorNote ?
|
|
115
|
+
</cre8-field-note>` : this.errorNote ? a` <cre8-field-note
|
|
283
116
|
?isError=${this.isError}
|
|
284
117
|
id=${this.validationAriaDescribedBy}
|
|
285
118
|
class="cre8-c-checkbox-field-item__field-note-error"
|
|
@@ -294,13 +127,13 @@ const h = class h extends x {
|
|
|
294
127
|
"cre8-c-checkbox-field-item--success": this.isSuccess,
|
|
295
128
|
"cre8-c-checkbox-field-item--disabled": this.disabled
|
|
296
129
|
});
|
|
297
|
-
return
|
|
130
|
+
return a`
|
|
298
131
|
<div role=${o(this.getRole())} class="${t}">
|
|
299
132
|
<input class="cre8-c-checkbox-field-item__input"
|
|
300
133
|
type="checkbox"
|
|
301
134
|
@input=${this._clickHandler}
|
|
302
135
|
id=${this.fieldId}
|
|
303
|
-
name=${this.name}
|
|
136
|
+
name=${this.name ?? void 0}
|
|
304
137
|
.value=${this.value}
|
|
305
138
|
required=${o(this.required)}
|
|
306
139
|
aria-invalid=${this.required ? !!this.isError : o(this.isError)}
|
|
@@ -310,70 +143,67 @@ const h = class h extends x {
|
|
|
310
143
|
@change=${this._handleOnChange}
|
|
311
144
|
/>
|
|
312
145
|
<span class="cre8-c-checkbox-field-item__custom-checkbox">
|
|
313
|
-
<cre8-icon svg='${
|
|
146
|
+
<cre8-icon svg='${x}' class="cre8-c-checkbox-field-item__icon" aria-label="checkbox"
|
|
314
147
|
aria-hidden="${!this.checked}"></cre8-icon>
|
|
315
148
|
</span>
|
|
316
149
|
<label class="cre8-c-checkbox-field-item__label" for=${this.fieldId}>${this.label}</label>
|
|
317
150
|
</div>
|
|
318
|
-
${this.fieldNote || this.slotNotEmpty("fieldNote") ?
|
|
151
|
+
${this.fieldNote || this.slotNotEmpty("fieldNote") ? a`<cre8-field-note id=${this.ariaDescribedBy} class="cre8-c-checkbox-field-item__field-note"
|
|
319
152
|
><slot name="fieldNote">${this.fieldNote}</slot></cre8-field-note
|
|
320
|
-
>` :
|
|
153
|
+
>` : b}
|
|
321
154
|
${this.renderSuccessErrorFieldNote()}
|
|
322
155
|
`;
|
|
323
156
|
}
|
|
324
157
|
};
|
|
325
|
-
|
|
326
|
-
let e =
|
|
158
|
+
n.styles = [y];
|
|
159
|
+
let e = n;
|
|
327
160
|
i([
|
|
328
|
-
|
|
161
|
+
r({ type: String })
|
|
329
162
|
], e.prototype, "label");
|
|
330
163
|
i([
|
|
331
|
-
|
|
164
|
+
r({ type: Boolean, reflect: !0 })
|
|
332
165
|
], e.prototype, "isError");
|
|
333
166
|
i([
|
|
334
|
-
|
|
167
|
+
r()
|
|
335
168
|
], e.prototype, "errorText");
|
|
336
169
|
i([
|
|
337
|
-
|
|
170
|
+
r()
|
|
338
171
|
], e.prototype, "errorNote");
|
|
339
172
|
i([
|
|
340
|
-
|
|
173
|
+
r({ type: Boolean, reflect: !0 })
|
|
341
174
|
], e.prototype, "isSuccess");
|
|
342
175
|
i([
|
|
343
|
-
|
|
176
|
+
r()
|
|
344
177
|
], e.prototype, "successText");
|
|
345
178
|
i([
|
|
346
|
-
|
|
179
|
+
r()
|
|
347
180
|
], e.prototype, "successNote");
|
|
348
181
|
i([
|
|
349
|
-
|
|
182
|
+
r({ type: Boolean, reflect: !0 })
|
|
350
183
|
], e.prototype, "disabled");
|
|
351
184
|
i([
|
|
352
|
-
|
|
185
|
+
r({ type: Boolean, reflect: !0 })
|
|
353
186
|
], e.prototype, "checked");
|
|
354
187
|
i([
|
|
355
|
-
|
|
188
|
+
r()
|
|
356
189
|
], e.prototype, "fieldId");
|
|
357
190
|
i([
|
|
358
|
-
|
|
191
|
+
r()
|
|
359
192
|
], e.prototype, "fieldNote");
|
|
360
193
|
i([
|
|
361
|
-
|
|
194
|
+
r()
|
|
362
195
|
], e.prototype, "ariaDescribedBy");
|
|
363
196
|
i([
|
|
364
|
-
|
|
197
|
+
r()
|
|
365
198
|
], e.prototype, "validationAriaDescribedBy");
|
|
366
199
|
i([
|
|
367
|
-
|
|
368
|
-
], e.prototype, "name");
|
|
369
|
-
i([
|
|
370
|
-
c({ type: Boolean, reflect: !0 })
|
|
200
|
+
r({ type: Boolean, reflect: !0 })
|
|
371
201
|
], e.prototype, "required");
|
|
372
202
|
i([
|
|
373
|
-
|
|
203
|
+
r()
|
|
374
204
|
], e.prototype, "fieldNoteIconName");
|
|
375
205
|
i([
|
|
376
|
-
|
|
206
|
+
u("input")
|
|
377
207
|
], e.prototype, "field");
|
|
378
208
|
customElements.get("cre8-checkbox-field-item") === void 0 && customElements.define("cre8-checkbox-field-item", e);
|
|
379
209
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-field-item.styles.d.ts","sourceRoot":"","sources":["../../../components/checkbox-field-item/checkbox-field-item.styles.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"checkbox-field-item.styles.d.ts","sourceRoot":"","sources":["../../../components/checkbox-field-item/checkbox-field-item.styles.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,yBAAmyL,CAAC;AAChzL,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended ElementInternals interface with form lifecycle callbacks
|
|
3
|
+
*/
|
|
4
|
+
export interface Cre8ElementInternals extends ElementInternals {
|
|
5
|
+
formResetCallback?: () => void;
|
|
6
|
+
ariaRole?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Context for sharing form element internals with descendant components.
|
|
10
|
+
* This allows nested components to access the parent form element's
|
|
11
|
+
* ElementInternals for form participation, validation, and ARIA.
|
|
12
|
+
*/
|
|
13
|
+
export declare const formInternalsContext: {
|
|
14
|
+
__context__: Cre8ElementInternals;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Context for sharing form element state with descendants
|
|
18
|
+
*/
|
|
19
|
+
export interface FormElementState {
|
|
20
|
+
value: string;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
required: boolean;
|
|
23
|
+
isError: boolean;
|
|
24
|
+
isSuccess: boolean;
|
|
25
|
+
name?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const formStateContext: {
|
|
28
|
+
__context__: FormElementState;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=form-internals-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-internals-context.d.ts","sourceRoot":"","sources":["../../../components/contexts/form-internals-context.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;CAEhC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,gBAAgB;;CAE5B,CAAC"}
|
|
@@ -1,44 +1,67 @@
|
|
|
1
1
|
import { Cre8Element } from './cre8-element';
|
|
2
|
+
import { type Cre8ElementInternals, type FormElementState } from './contexts/form-internals-context';
|
|
3
|
+
export { type Cre8ElementInternals, type FormElementState } from './contexts/form-internals-context';
|
|
4
|
+
/**
|
|
5
|
+
* Base class for form-associated custom elements.
|
|
6
|
+
* Provides ElementInternals context to descendant components.
|
|
7
|
+
*/
|
|
2
8
|
export declare abstract class Cre8FormElement extends Cre8Element {
|
|
3
9
|
/**
|
|
4
10
|
* @internal
|
|
5
|
-
*
|
|
6
11
|
* Tells the browser to treat the element like a form field.
|
|
7
12
|
* Ties the element to the HTML form it is in.
|
|
8
|
-
*
|
|
9
13
|
*/
|
|
10
14
|
static formAssociated: boolean;
|
|
11
|
-
abstract type: string;
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
*
|
|
16
|
-
* An instance of element internals.
|
|
17
|
-
* Contains properties and methods that allows the element
|
|
18
|
-
* to participate fully in the HTML form it's in.
|
|
16
|
+
* The type of form control (text, checkbox, radio, etc.)
|
|
19
17
|
*/
|
|
20
|
-
|
|
18
|
+
abstract type: string;
|
|
21
19
|
/**
|
|
22
20
|
* @protected
|
|
23
21
|
* @internal
|
|
24
|
-
*
|
|
25
22
|
* Stores the value for the `value` getter and setter.
|
|
26
23
|
*/
|
|
27
|
-
internalValue: string;
|
|
28
|
-
|
|
24
|
+
protected internalValue: string;
|
|
25
|
+
/**
|
|
26
|
+
* The underlying HTML form field element.
|
|
27
|
+
* Should be implemented with `@query` in extending classes.
|
|
28
|
+
*/
|
|
29
|
+
protected field?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLButtonElement;
|
|
29
30
|
/**
|
|
30
31
|
* @internal
|
|
31
|
-
*
|
|
32
|
-
* Stores the intial value of the field so that it can be reset
|
|
32
|
+
* Stores the initial value for form reset functionality
|
|
33
33
|
*/
|
|
34
34
|
protected defaultValue: string | boolean;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
* Provides ElementInternals to descendant components via context.
|
|
37
|
+
* Descendants can consume this to access form participation APIs.
|
|
38
|
+
*/
|
|
39
|
+
_internals: Cre8ElementInternals;
|
|
40
|
+
/**
|
|
41
|
+
* Provides form element state to descendants via context.
|
|
42
|
+
* Useful for nested components that need to react to form state.
|
|
40
43
|
*/
|
|
41
|
-
|
|
44
|
+
_formState: FormElementState;
|
|
45
|
+
/**
|
|
46
|
+
* The name of the form field
|
|
47
|
+
*/
|
|
48
|
+
name?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the field is disabled
|
|
51
|
+
*/
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the field is required
|
|
55
|
+
*/
|
|
56
|
+
required?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the field is in an error state
|
|
59
|
+
*/
|
|
60
|
+
isError?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether the field is in a success state
|
|
63
|
+
*/
|
|
64
|
+
isSuccess?: boolean;
|
|
42
65
|
/**
|
|
43
66
|
* The value of the form field.
|
|
44
67
|
*/
|
|
@@ -46,17 +69,68 @@ export declare abstract class Cre8FormElement extends Cre8Element {
|
|
|
46
69
|
/**
|
|
47
70
|
* Sets the value of the form field.
|
|
48
71
|
* 1. Stores the new value so it can be retrieved by the getter.
|
|
49
|
-
* 2. Sets the current value of the control.
|
|
50
|
-
* 3. Updates the actual field.
|
|
51
|
-
* 4.
|
|
72
|
+
* 2. Sets the current value of the control via ElementInternals.
|
|
73
|
+
* 3. Updates the actual field element.
|
|
74
|
+
* 4. Updates the form state context.
|
|
75
|
+
* 5. Triggers a re-render.
|
|
52
76
|
*/
|
|
53
77
|
set value(newValue: string);
|
|
54
78
|
/**
|
|
55
|
-
*
|
|
79
|
+
* Updates the form state context for descendant consumption
|
|
80
|
+
*/
|
|
81
|
+
protected updateFormState(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Updates the actual field element's value
|
|
56
84
|
*/
|
|
57
85
|
protected updateField(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Lifecycle hook called after first render
|
|
88
|
+
*/
|
|
58
89
|
protected firstUpdated(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Called when properties change
|
|
92
|
+
*/
|
|
93
|
+
protected updated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Form lifecycle callback - called when the form is reset
|
|
96
|
+
*/
|
|
59
97
|
formResetCallback(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Form lifecycle callback - called when the element is disabled via fieldset
|
|
100
|
+
*/
|
|
101
|
+
formDisabledCallback(disabled: boolean): void;
|
|
102
|
+
/**
|
|
103
|
+
* Form lifecycle callback - called when form state is restored
|
|
104
|
+
*/
|
|
105
|
+
formStateRestoreCallback(state: string | FormData | null, _mode: 'restore' | 'autocomplete'): void;
|
|
106
|
+
/**
|
|
107
|
+
* Gets the form associated with this element
|
|
108
|
+
*/
|
|
109
|
+
get form(): HTMLFormElement | null;
|
|
110
|
+
/**
|
|
111
|
+
* Gets the validation message
|
|
112
|
+
*/
|
|
113
|
+
get validationMessage(): string;
|
|
114
|
+
/**
|
|
115
|
+
* Gets the validity state
|
|
116
|
+
*/
|
|
117
|
+
get validity(): ValidityState | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Gets whether the element will be validated
|
|
120
|
+
*/
|
|
121
|
+
get willValidate(): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Checks validity and reports to the user
|
|
124
|
+
*/
|
|
125
|
+
reportValidity(): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Checks validity without reporting
|
|
128
|
+
*/
|
|
129
|
+
checkValidity(): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Sets a custom validity message
|
|
132
|
+
*/
|
|
133
|
+
setCustomValidity(message: string): void;
|
|
60
134
|
constructor();
|
|
61
135
|
}
|
|
62
136
|
export default Cre8FormElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cre8-form-element.d.ts","sourceRoot":"","sources":["../../components/cre8-form-element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cre8-form-element.d.ts","sourceRoot":"","sources":["../../components/cre8-form-element.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAGH,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACxB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErG;;;GAGG;AACH,8BAAsB,eAAgB,SAAQ,WAAW;IACrD;;;;OAIG;IACH,MAAM,CAAC,cAAc,UAAQ;IAE7B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,SAAS,CAAC,aAAa,EAAE,MAAM,CAAM;IAErC;;;OAGG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;IAEjG;;;OAGG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAM;IAE9C;;;OAGG;IAEH,UAAU,EAAE,oBAAoB,CAAC;IAEjC;;;OAGG;IAEH,UAAU,EAAE,gBAAgB,CAM1B;IAEF;;OAEG;IAEH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IAEH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IAEH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IAEH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,IACI,KAAK,IAAI,MAAM,CAElB;IAED;;;;;;;OAOG;IACH,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,EAYzB;IAED;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;IAWjC;;OAEG;IACH,SAAS,CAAC,WAAW,IAAI,IAAI;IAM7B;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAQ9B;;OAEG;IACH,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,IAAI;IAerE;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAKzB;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAI7C;;OAEG;IACH,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,cAAc,GAAG,IAAI;IAMlG;;OAEG;IACH,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,aAAa,GAAG,SAAS,CAExC;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED;;OAEG;IACH,cAAc,IAAI,OAAO;IAIzB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;;CAc3C;AAED,eAAe,eAAe,CAAC"}
|