@skedulo/breeze-ui 0.11.0 → 1.0.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/package.json +42 -8
  2. package/dist/custom-elements.json +0 -33408
  3. package/dist/lib/cjs/breeze-ui.js +0 -5000
  4. package/dist/lib/cjs/package.json +0 -3
  5. package/dist/lib/es/breeze-ui.js +0 -25629
  6. package/dist/lib/es/package.json +0 -3
  7. package/dist/tsconfig.tsbuildinfo +0 -1
  8. package/dist/types/animation/fade-in-out.d.ts +0 -37
  9. package/dist/types/animation/fade-in-out.d.ts.map +0 -1
  10. package/dist/types/animation/index.d.ts +0 -2
  11. package/dist/types/animation/index.d.ts.map +0 -1
  12. package/dist/types/components/alert.d.ts +0 -58
  13. package/dist/types/components/alert.d.ts.map +0 -1
  14. package/dist/types/components/avatar.d.ts +0 -131
  15. package/dist/types/components/avatar.d.ts.map +0 -1
  16. package/dist/types/components/badge.d.ts +0 -58
  17. package/dist/types/components/badge.d.ts.map +0 -1
  18. package/dist/types/components/button.d.ts +0 -157
  19. package/dist/types/components/button.d.ts.map +0 -1
  20. package/dist/types/components/combo-box.d.ts +0 -33
  21. package/dist/types/components/combo-box.d.ts.map +0 -1
  22. package/dist/types/components/confirmation-dialog.d.ts +0 -44
  23. package/dist/types/components/confirmation-dialog.d.ts.map +0 -1
  24. package/dist/types/components/dropdown-button.d.ts +0 -44
  25. package/dist/types/components/dropdown-button.d.ts.map +0 -1
  26. package/dist/types/components/form-elements/code-theme.d.ts +0 -2
  27. package/dist/types/components/form-elements/code-theme.d.ts.map +0 -1
  28. package/dist/types/components/form-elements/index.d.ts +0 -14
  29. package/dist/types/components/form-elements/index.d.ts.map +0 -1
  30. package/dist/types/components/form-elements/input-base.d.ts +0 -76
  31. package/dist/types/components/form-elements/input-base.d.ts.map +0 -1
  32. package/dist/types/components/form-elements/input-checkbox.d.ts +0 -61
  33. package/dist/types/components/form-elements/input-checkbox.d.ts.map +0 -1
  34. package/dist/types/components/form-elements/input-code.d.ts +0 -78
  35. package/dist/types/components/form-elements/input-code.d.ts.map +0 -1
  36. package/dist/types/components/form-elements/input-error.d.ts +0 -23
  37. package/dist/types/components/form-elements/input-error.d.ts.map +0 -1
  38. package/dist/types/components/form-elements/input-guide.d.ts +0 -24
  39. package/dist/types/components/form-elements/input-guide.d.ts.map +0 -1
  40. package/dist/types/components/form-elements/input-multiselect.d.ts +0 -136
  41. package/dist/types/components/form-elements/input-multiselect.d.ts.map +0 -1
  42. package/dist/types/components/form-elements/input-number.d.ts +0 -72
  43. package/dist/types/components/form-elements/input-number.d.ts.map +0 -1
  44. package/dist/types/components/form-elements/input-radio.d.ts +0 -87
  45. package/dist/types/components/form-elements/input-radio.d.ts.map +0 -1
  46. package/dist/types/components/form-elements/input-select-base.d.ts +0 -218
  47. package/dist/types/components/form-elements/input-select-base.d.ts.map +0 -1
  48. package/dist/types/components/form-elements/input-select.d.ts +0 -92
  49. package/dist/types/components/form-elements/input-select.d.ts.map +0 -1
  50. package/dist/types/components/form-elements/input-text-base.d.ts +0 -36
  51. package/dist/types/components/form-elements/input-text-base.d.ts.map +0 -1
  52. package/dist/types/components/form-elements/input-text.d.ts +0 -38
  53. package/dist/types/components/form-elements/input-text.d.ts.map +0 -1
  54. package/dist/types/components/form-elements/input-textarea.d.ts +0 -39
  55. package/dist/types/components/form-elements/input-textarea.d.ts.map +0 -1
  56. package/dist/types/components/form-elements/input-time.d.ts +0 -106
  57. package/dist/types/components/form-elements/input-time.d.ts.map +0 -1
  58. package/dist/types/components/form-elements/labeled-input.d.ts +0 -93
  59. package/dist/types/components/form-elements/labeled-input.d.ts.map +0 -1
  60. package/dist/types/components/heading.d.ts +0 -32
  61. package/dist/types/components/heading.d.ts.map +0 -1
  62. package/dist/types/components/icon/icon.d.ts +0 -30
  63. package/dist/types/components/icon/icon.d.ts.map +0 -1
  64. package/dist/types/components/icon/icons.d.ts +0 -16
  65. package/dist/types/components/icon/icons.d.ts.map +0 -1
  66. package/dist/types/components/icon/index.d.ts +0 -3
  67. package/dist/types/components/icon/index.d.ts.map +0 -1
  68. package/dist/types/components/icon/legacy-icons.d.ts +0 -9
  69. package/dist/types/components/icon/legacy-icons.d.ts.map +0 -1
  70. package/dist/types/components/illustration/illustration.d.ts +0 -41
  71. package/dist/types/components/illustration/illustration.d.ts.map +0 -1
  72. package/dist/types/components/illustration/illustrations.d.ts +0 -6
  73. package/dist/types/components/illustration/illustrations.d.ts.map +0 -1
  74. package/dist/types/components/illustration/index.d.ts +0 -3
  75. package/dist/types/components/illustration/index.d.ts.map +0 -1
  76. package/dist/types/components/index.d.ts +0 -27
  77. package/dist/types/components/index.d.ts.map +0 -1
  78. package/dist/types/components/inline-edit/index.d.ts +0 -7
  79. package/dist/types/components/inline-edit/index.d.ts.map +0 -1
  80. package/dist/types/components/inline-edit/inline-edit-controls.d.ts +0 -29
  81. package/dist/types/components/inline-edit/inline-edit-controls.d.ts.map +0 -1
  82. package/dist/types/components/inline-edit/inline-edit-field.d.ts +0 -203
  83. package/dist/types/components/inline-edit/inline-edit-field.d.ts.map +0 -1
  84. package/dist/types/components/inline-edit/inline-edit-group.d.ts +0 -60
  85. package/dist/types/components/inline-edit/inline-edit-group.d.ts.map +0 -1
  86. package/dist/types/components/inline-edit/inline-edit.base.d.ts +0 -52
  87. package/dist/types/components/inline-edit/inline-edit.base.d.ts.map +0 -1
  88. package/dist/types/components/inline-edit/inline-edit.const.d.ts +0 -6
  89. package/dist/types/components/inline-edit/inline-edit.const.d.ts.map +0 -1
  90. package/dist/types/components/inline-edit/inline-edit.events.d.ts +0 -32
  91. package/dist/types/components/inline-edit/inline-edit.events.d.ts.map +0 -1
  92. package/dist/types/components/inline-edit/inline-edit.styles.d.ts +0 -4
  93. package/dist/types/components/inline-edit/inline-edit.styles.d.ts.map +0 -1
  94. package/dist/types/components/inline-edit/inline-edit.types.d.ts +0 -45
  95. package/dist/types/components/inline-edit/inline-edit.types.d.ts.map +0 -1
  96. package/dist/types/components/legacy-scoped-components.d.ts +0 -269
  97. package/dist/types/components/legacy-scoped-components.d.ts.map +0 -1
  98. package/dist/types/components/link.d.ts +0 -102
  99. package/dist/types/components/link.d.ts.map +0 -1
  100. package/dist/types/components/loading.d.ts +0 -27
  101. package/dist/types/components/loading.d.ts.map +0 -1
  102. package/dist/types/components/lozenge.d.ts +0 -94
  103. package/dist/types/components/lozenge.d.ts.map +0 -1
  104. package/dist/types/components/menu/dropdown-menu.d.ts +0 -142
  105. package/dist/types/components/menu/dropdown-menu.d.ts.map +0 -1
  106. package/dist/types/components/menu/index.d.ts +0 -4
  107. package/dist/types/components/menu/index.d.ts.map +0 -1
  108. package/dist/types/components/menu/menu-item.d.ts +0 -103
  109. package/dist/types/components/menu/menu-item.d.ts.map +0 -1
  110. package/dist/types/components/menu/menu.const.d.ts +0 -3
  111. package/dist/types/components/menu/menu.const.d.ts.map +0 -1
  112. package/dist/types/components/menu/menu.d.ts +0 -188
  113. package/dist/types/components/menu/menu.d.ts.map +0 -1
  114. package/dist/types/components/modal/index.d.ts +0 -3
  115. package/dist/types/components/modal/index.d.ts.map +0 -1
  116. package/dist/types/components/modal/layout.d.ts +0 -60
  117. package/dist/types/components/modal/layout.d.ts.map +0 -1
  118. package/dist/types/components/modal/modal.d.ts +0 -75
  119. package/dist/types/components/modal/modal.d.ts.map +0 -1
  120. package/dist/types/components/navigation/index.d.ts +0 -3
  121. package/dist/types/components/navigation/index.d.ts.map +0 -1
  122. package/dist/types/components/navigation/side-navigation-item.d.ts +0 -33
  123. package/dist/types/components/navigation/side-navigation-item.d.ts.map +0 -1
  124. package/dist/types/components/navigation/side-navigation.d.ts +0 -23
  125. package/dist/types/components/navigation/side-navigation.d.ts.map +0 -1
  126. package/dist/types/components/pagination-utils.d.ts +0 -2
  127. package/dist/types/components/pagination-utils.d.ts.map +0 -1
  128. package/dist/types/components/pagination.d.ts +0 -106
  129. package/dist/types/components/pagination.d.ts.map +0 -1
  130. package/dist/types/components/popover.d.ts +0 -188
  131. package/dist/types/components/popover.d.ts.map +0 -1
  132. package/dist/types/components/record-field/index.d.ts +0 -5
  133. package/dist/types/components/record-field/index.d.ts.map +0 -1
  134. package/dist/types/components/record-field/record-field-label.d.ts +0 -22
  135. package/dist/types/components/record-field/record-field-label.d.ts.map +0 -1
  136. package/dist/types/components/record-field/record-field.const.d.ts +0 -5
  137. package/dist/types/components/record-field/record-field.const.d.ts.map +0 -1
  138. package/dist/types/components/record-field/record-field.d.ts +0 -67
  139. package/dist/types/components/record-field/record-field.d.ts.map +0 -1
  140. package/dist/types/components/record-field/record-field.styles.d.ts +0 -4
  141. package/dist/types/components/record-field/record-field.styles.d.ts.map +0 -1
  142. package/dist/types/components/record-field/record-field.types.d.ts +0 -27
  143. package/dist/types/components/record-field/record-field.types.d.ts.map +0 -1
  144. package/dist/types/components/record-row.d.ts +0 -37
  145. package/dist/types/components/record-row.d.ts.map +0 -1
  146. package/dist/types/components/tabs/index.d.ts +0 -37
  147. package/dist/types/components/tabs/index.d.ts.map +0 -1
  148. package/dist/types/components/tabs/panel.d.ts +0 -29
  149. package/dist/types/components/tabs/panel.d.ts.map +0 -1
  150. package/dist/types/components/tabs/tab-bar.d.ts +0 -36
  151. package/dist/types/components/tabs/tab-bar.d.ts.map +0 -1
  152. package/dist/types/components/tabs/tab-events.d.ts +0 -11
  153. package/dist/types/components/tabs/tab-events.d.ts.map +0 -1
  154. package/dist/types/components/tabs/tab.d.ts +0 -34
  155. package/dist/types/components/tabs/tab.d.ts.map +0 -1
  156. package/dist/types/components/tooltip.d.ts +0 -66
  157. package/dist/types/components/tooltip.d.ts.map +0 -1
  158. package/dist/types/components/virtual-list.d.ts +0 -195
  159. package/dist/types/components/virtual-list.d.ts.map +0 -1
  160. package/dist/types/helpers/css-helpers.d.ts +0 -34
  161. package/dist/types/helpers/css-helpers.d.ts.map +0 -1
  162. package/dist/types/helpers/index.d.ts +0 -2
  163. package/dist/types/helpers/index.d.ts.map +0 -1
  164. package/dist/types/layout/flex.d.ts +0 -49
  165. package/dist/types/layout/flex.d.ts.map +0 -1
  166. package/dist/types/layout/footer.d.ts +0 -23
  167. package/dist/types/layout/footer.d.ts.map +0 -1
  168. package/dist/types/layout/grid/grid-item.d.ts +0 -43
  169. package/dist/types/layout/grid/grid-item.d.ts.map +0 -1
  170. package/dist/types/layout/grid/grid.d.ts +0 -50
  171. package/dist/types/layout/grid/grid.d.ts.map +0 -1
  172. package/dist/types/layout/grid/index.d.ts +0 -3
  173. package/dist/types/layout/grid/index.d.ts.map +0 -1
  174. package/dist/types/layout/header-footer-page.d.ts +0 -23
  175. package/dist/types/layout/header-footer-page.d.ts.map +0 -1
  176. package/dist/types/layout/header.d.ts +0 -25
  177. package/dist/types/layout/header.d.ts.map +0 -1
  178. package/dist/types/layout/index.d.ts +0 -9
  179. package/dist/types/layout/index.d.ts.map +0 -1
  180. package/dist/types/layout/page-header.d.ts +0 -53
  181. package/dist/types/layout/page-header.d.ts.map +0 -1
  182. package/dist/types/layout/responsive-columns.d.ts +0 -23
  183. package/dist/types/layout/responsive-columns.d.ts.map +0 -1
  184. package/dist/types/layout/split-row.d.ts +0 -84
  185. package/dist/types/layout/split-row.d.ts.map +0 -1
  186. package/dist/types/main.d.ts +0 -7
  187. package/dist/types/main.d.ts.map +0 -1
  188. package/dist/types/mixins/component-utils.d.ts +0 -18
  189. package/dist/types/mixins/component-utils.d.ts.map +0 -1
  190. package/dist/types/mixins/index.d.ts +0 -2
  191. package/dist/types/mixins/index.d.ts.map +0 -1
  192. package/dist/types/storybook/colors.stories.d.ts +0 -20
  193. package/dist/types/storybook/colors.stories.d.ts.map +0 -1
  194. package/dist/types/styles/borders.d.ts +0 -2
  195. package/dist/types/styles/borders.d.ts.map +0 -1
  196. package/dist/types/styles/breakpoints.d.ts +0 -15
  197. package/dist/types/styles/breakpoints.d.ts.map +0 -1
  198. package/dist/types/styles/colors.d.ts +0 -176
  199. package/dist/types/styles/colors.d.ts.map +0 -1
  200. package/dist/types/styles/global-styles.d.ts +0 -18
  201. package/dist/types/styles/global-styles.d.ts.map +0 -1
  202. package/dist/types/styles/index.d.ts +0 -3
  203. package/dist/types/styles/index.d.ts.map +0 -1
  204. package/dist/types/styles/legacy-scoped-variables.d.ts +0 -17
  205. package/dist/types/styles/legacy-scoped-variables.d.ts.map +0 -1
  206. package/dist/types/styles/shadows.d.ts +0 -2
  207. package/dist/types/styles/shadows.d.ts.map +0 -1
  208. package/dist/types/styles/spacing.d.ts +0 -7
  209. package/dist/types/styles/spacing.d.ts.map +0 -1
  210. package/dist/types/styles/typography.d.ts +0 -2
  211. package/dist/types/styles/typography.d.ts.map +0 -1
  212. package/dist/types/styles/z-index.d.ts +0 -2
  213. package/dist/types/styles/z-index.d.ts.map +0 -1
  214. package/dist/types/surfaces/card/card-footer.d.ts +0 -15
  215. package/dist/types/surfaces/card/card-footer.d.ts.map +0 -1
  216. package/dist/types/surfaces/card/card-header.d.ts +0 -16
  217. package/dist/types/surfaces/card/card-header.d.ts.map +0 -1
  218. package/dist/types/surfaces/card/card-section-header.d.ts +0 -15
  219. package/dist/types/surfaces/card/card-section-header.d.ts.map +0 -1
  220. package/dist/types/surfaces/card/card.const.d.ts +0 -5
  221. package/dist/types/surfaces/card/card.const.d.ts.map +0 -1
  222. package/dist/types/surfaces/card/card.d.ts +0 -33
  223. package/dist/types/surfaces/card/card.d.ts.map +0 -1
  224. package/dist/types/surfaces/card/card.styles.d.ts +0 -5
  225. package/dist/types/surfaces/card/card.styles.d.ts.map +0 -1
  226. package/dist/types/surfaces/card/card.types.d.ts +0 -49
  227. package/dist/types/surfaces/card/card.types.d.ts.map +0 -1
  228. package/dist/types/surfaces/card/index.d.ts +0 -7
  229. package/dist/types/surfaces/card/index.d.ts.map +0 -1
  230. package/dist/types/surfaces/index.d.ts +0 -3
  231. package/dist/types/surfaces/index.d.ts.map +0 -1
  232. package/dist/types/surfaces/paper.d.ts +0 -29
  233. package/dist/types/surfaces/paper.d.ts.map +0 -1
  234. package/dist/types/types.d.ts +0 -11
  235. package/dist/types/types.d.ts.map +0 -1
  236. package/dist/types/utils/findParentWithType.d.ts +0 -4
  237. package/dist/types/utils/findParentWithType.d.ts.map +0 -1
  238. package/dist/types/utils/index.d.ts +0 -3
  239. package/dist/types/utils/index.d.ts.map +0 -1
  240. package/dist/types/utils/lit-utils.d.ts +0 -29
  241. package/dist/types/utils/lit-utils.d.ts.map +0 -1
  242. package/dist/types/utils/test-utils.d.ts +0 -72
  243. package/dist/types/utils/test-utils.d.ts.map +0 -1
@@ -1,203 +0,0 @@
1
- import { PropertyValues, TemplateResult } from 'lit';
2
- import { InputSizes, LabelPosition, RecordFieldImpl } from '../record-field';
3
- import { InlineEditBase } from './inline-edit.base';
4
- import type { InlineEditFieldReactiveProperties } from './inline-edit.types';
5
- import '../record-field';
6
- import '../button';
7
- import '../../layout/flex';
8
- import '../lozenge';
9
- import '../icon';
10
- import '../tooltip';
11
- /**
12
- * Toggles a read/edit layout for the value of a given form field.
13
- *
14
- * Expects to wrap a Breeze Input component, or custom solution wrapped in a
15
- * LabeledInput or RecordField.
16
- *
17
- * @csspart read-mode-label Apply custom styles to the label text in read-mode
18
- * @csspart read-mode-value-button Apply custom styles to the value button in read-mode
19
- *
20
- * @fires {InlineEditFieldBroadcastEvent} brz-inline-edit-field-broadcast When the read-mode button is clicked
21
- * @fires {InlineEditFieldModeChangeEvent} brz-inline-edit-field-mode-change When the field mode changes
22
- *
23
- * @listens {InlineEditControlsCancelEvent} brz-inline-edit-controls-cancel
24
- * @listens {InlineEditControlsSaveEvent} brz-inline-edit-controls-save
25
- *
26
- * @see InlineEditControls
27
- * @see InlineEditGroup
28
- *
29
- * @slot children The "edit" template - Expects a Breeze Input or custom implementation using LabeledInput or RecordField.
30
- * @slot controls Overrides the field controls. Defaults to save/cancel buttons.
31
- * @slot error Something to render below the controls when in "error" mode
32
- * @slot read-mode Overrides the default "read mode" value template
33
- *
34
- * @tag brz-inline-edit-field
35
- */
36
- export declare class InlineEditField<ValueType = unknown> extends InlineEditBase implements RecordFieldImpl {
37
- static styles: import("lit").CSSResult[];
38
- /**
39
- * A controlled field defers the `mode` state management to an external
40
- * controller, usually an `InlineEditGroup`.
41
- */
42
- controlled: boolean;
43
- /**
44
- * Truncates the field value in read mode.
45
- */
46
- truncate: boolean;
47
- /**
48
- * Stores the label position derived from a wrapped Breeze Input.
49
- *
50
- * @internal
51
- */
52
- labelPosition: LabelPosition;
53
- /**
54
- * Stores the size derived from a wrapped Breeze Input.
55
- *
56
- * @internal
57
- */
58
- size: InputSizes;
59
- /**
60
- * Stores the value derived from a wrapped Breeze Input.
61
- *
62
- * @internal
63
- */
64
- private value?;
65
- /**
66
- * Stores the options derived from a wrapped Breeze Input, if supported.
67
- *
68
- * @internal
69
- */
70
- private options;
71
- /**
72
- * Stores a reference to the slotted label of a wrapped input.
73
- *
74
- * @internal
75
- */
76
- private label?;
77
- /** @internal */
78
- private hasLabel;
79
- /** @internal */
80
- private isValueOverflowing;
81
- /** @internal */
82
- private valueElement?;
83
- connectedCallback(): void;
84
- protected updated(changedProperties: PropertyValues<InlineEditFieldReactiveProperties>): void;
85
- /**
86
- * Applies the overflowing state based on the rendered height of the value
87
- * element. Line height is 20px so when it hits double line height we can
88
- * assume that it's a multiline text value and needs extra padding.
89
- *
90
- * @private
91
- */
92
- private setOverflowingState;
93
- /**
94
- * To avoid repetition, we extract the values of common properties from the
95
- * wrapped Breeze Input and store them in state.
96
- */
97
- private setStateFromInputElement;
98
- /**
99
- * Sets the options state from the children of supporting input elements.
100
- */
101
- private setOptionsFromChildren;
102
- /**
103
- * If the field is controlled and unlocked, an event is emitted. Otherwise the
104
- * mode is toggled internally.
105
- *
106
- * Finally, attempts to focus the wrapped input after the template switches.
107
- */
108
- private handleValueClick;
109
- /**
110
- * Looks for and returns the default slotted field element, which is rendered
111
- * in edit mode.
112
- *
113
- * We typically expect this to be a Breeze Input, or a custom implementation
114
- * that wraps an input inside LabeledInput or RecordField. This is because the
115
- * InlineEditField internals depend on the common interface they all share, so
116
- * we throw errors here if the component has been used incorrectly.
117
- *
118
- * @internal
119
- */
120
- private get fieldElement();
121
- /**
122
- * Looks for and returns the slotted input element used for edit mode.
123
- *
124
- * Sometimes it is necessary to wrap an input in a RecordField for consistent
125
- * layouts (e.g. InputCheckbox is self-labelling so does not extend from
126
- * LabeledInput like the others).
127
- *
128
- * Here we check if the default slotted element is a RecordField, and if so
129
- * drill further to find the underlying input element.
130
- *
131
- * @internal
132
- */
133
- private get inputElement();
134
- /**
135
- * Handles cases where a RecordField is used to wrap inputs that are usually
136
- * self-labelling, such as InputCheckbox. To avoid wonky layouts we grab the
137
- * label from its default slot then slot it into the RecordField's label slot.
138
- */
139
- private generateFieldLabelSlot;
140
- /**
141
- * Handles displaying friendly, readable values for different input types.
142
- *
143
- * When the value is actually a list (e.g. multiselect) we try to extract the
144
- * underlying value label from the input's options list, if present.
145
- *
146
- * List values are always parsed and separated into something readable.
147
- *
148
- * Checkbox values are typically not "useful" to read outside of a database,
149
- * so instead we look at the `checked` boolean property and return that as a
150
- * readable string.
151
- *
152
- * @internal
153
- */
154
- private get friendlyValue();
155
- /**
156
- * Renders a Select/Multiselect value into a Lozenge
157
- */
158
- private getSelectValueTemplate;
159
- /**
160
- * Renders a Checkbox value into a Lozenge
161
- */
162
- private getCheckboxValueTemplate;
163
- /**
164
- * Queries the Shadow DOM of a wrapped Breeze Input to extract and return the
165
- * element assigned to its `label` slot. This enables us to store a reference
166
- * in state and clone the element into the `read` template.
167
- *
168
- * @internal
169
- */
170
- private get slottedInputLabel();
171
- /**
172
- * Invokes a field-level save function if present, otherwise uses a group save
173
- * function.
174
- */
175
- protected handleSave(): Promise<void>;
176
- /**
177
- * The layout to render in read mode.
178
- *
179
- * @internal
180
- */
181
- private get readModeTemplate();
182
- /**
183
- * The template to render in edit mode. This is just a default slot, and we
184
- * expect it to be a Breeze Input or LabeledInput.
185
- *
186
- * @internal
187
- */
188
- private get editModeTemplate();
189
- /**
190
- * Returns the closest ancestor InlineEditGroup, if there is one.
191
- *
192
- * @internal
193
- */
194
- private get group();
195
- /**
196
- * Dispatches an event containing a reference to this component and its
197
- * current mode. Groups listen for this broadcast to know when to trigger
198
- * their controlled fields to change mode.
199
- */
200
- private emitBroadcastEvent;
201
- protected render(): TemplateResult;
202
- }
203
- //# sourceMappingURL=inline-edit-field.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-edit-field.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-edit/inline-edit-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAa1D,OAAO,EACL,UAAU,EACV,aAAa,EAEb,eAAe,EAChB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAOnD,OAAO,KAAK,EAEV,iCAAiC,EAClC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,iBAAiB,CAAA;AACxB,OAAO,WAAW,CAAA;AAClB,OAAO,mBAAmB,CAAA;AAC1B,OAAO,YAAY,CAAA;AACnB,OAAO,SAAS,CAAA;AAChB,OAAO,YAAY,CAAA;AAWnB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBACa,eAAe,CAAC,SAAS,GAAG,OAAO,CAC9C,SAAQ,cACR,YAAW,eAAe;IAE1B,MAAM,CAAC,MAAM,4BAA0B;IAEvC;;;OAGG;IAEH,UAAU,UAAQ;IAElB;;OAEG;IAEH,QAAQ,UAAQ;IAEhB;;;;OAIG;IAEH,aAAa,EAAE,aAAa,CAAQ;IAEpC;;;;OAIG;IAEH,IAAI,EAAE,UAAU,CAAW;IAE3B;;;;OAIG;IAEH,OAAO,CAAC,KAAK,CAAC,CAAW;IAEzB;;;;OAIG;IAEH,OAAO,CAAC,OAAO,CAA+B;IAE9C;;;;OAIG;IACM,OAAO,CAAC,KAAK,CAAC,CAAM;IAE7B,gBAAgB;IACP,OAAO,CAAC,QAAQ,CAAQ;IAEjC,gBAAgB;IACP,OAAO,CAAC,kBAAkB,CAAQ;IAE3C,gBAAgB;IACC,OAAO,CAAC,YAAY,CAAC,CAAiB;IAEvD,iBAAiB;IAQjB,SAAS,CAAC,OAAO,CACf,iBAAiB,EAAE,cAAc,CAAC,iCAAiC,CAAC;IAwBtE;;;;;;OAMG;YACW,mBAAmB;IAOjC;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IA4BhC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAmB9B;;;;;OAKG;YACW,gBAAgB;IAY9B;;;;;;;;;;OAUG;IACH,OAAO,KAAK,YAAY,GAiBvB;IAED;;;;;;;;;;;OAWG;IACH,OAAO,KAAK,YAAY,GAoBvB;IAED;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAoB9B;;;;;;;;;;;;;OAaG;IACH,OAAO,KAAK,aAAa,GAgCxB;IAED;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAQ9B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAWhC;;;;;;OAMG;IACH,OAAO,KAAK,iBAAiB,GAE5B;IAED;;;OAGG;cACa,UAAU;IAI1B;;;;OAIG;IACH,OAAO,KAAK,gBAAgB,GA6C3B;IAED;;;;;OAKG;IACH,OAAO,KAAK,gBAAgB,GAyB3B;IAED;;;;OAIG;IACH,OAAO,KAAK,KAAK,GAEhB;IAED;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAQ1B,SAAS,CAAC,MAAM,IAAI,cAAc;CAanC"}
@@ -1,60 +0,0 @@
1
- import { PropertyValues, TemplateResult } from 'lit';
2
- import { InlineEditField } from './inline-edit-field';
3
- import { InlineEditBase } from './inline-edit.base';
4
- import { InlineEditGroupReactiveProperties } from './inline-edit.types';
5
- /**
6
- * Wraps multiple InlineEditField components.
7
- *
8
- * Can optionally be made a `controller` group so that all registered fields are
9
- * toggled at once.
10
- *
11
- * @csspart container Apply style overrides to the group container element
12
- *
13
- * @fires {InlineEditGroupModeChangeEvent} brz-inline-edit-group-mode-change When the group mode changes
14
- *
15
- * @listens {InlineEditControlsCancelEvent} brz-inline-edit-controls-cancel
16
- * @listens {InlineEditControlsSaveEvent} brz-inline-edit-controls-save
17
- * @listens {InlineEditFieldBroadcastEvent} brz-inline-edit-field-broadcast
18
- *
19
- * @see InlineEditControls
20
- * @see InlineEditField
21
- *
22
- * @slot children One or more InlineEditField components, which can be wrapped in a more complex layout where necessary
23
- * @slot controls Overrides the group controls. Defaults to save/cancel buttons.
24
- * @slot error Something to render below the controls when in "error" mode
25
- *
26
- * @tag brz-inline-edit-group
27
- */
28
- export declare class InlineEditGroup extends InlineEditBase {
29
- static styles: import("lit").CSSResult[];
30
- /**
31
- * A control group takes responsibility for toggling the mode of all its
32
- * fields. The fields cannot control their own mode, and instead dispatch an
33
- * event for the group to react to.
34
- */
35
- controller: boolean;
36
- /**
37
- * The InlineEditFields registered to this group
38
- *
39
- * @internal
40
- */
41
- private fields;
42
- /**
43
- * Toggles all field modes if this is a control group
44
- */
45
- private handleInlineEditFieldViewModeClick;
46
- protected handleSave(): Promise<void>;
47
- /**
48
- * Enables a field to register itself to a group.
49
- */
50
- registerField(field: InlineEditField): void;
51
- protected updated(changedProperties: PropertyValues<InlineEditGroupReactiveProperties>): void;
52
- /**
53
- * Default slot template with a custom event listener attached.
54
- *
55
- * @internal
56
- */
57
- private get defaultSlot();
58
- protected render(): TemplateResult;
59
- }
60
- //# sourceMappingURL=inline-edit-group.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-edit-group.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-edit/inline-edit-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAInD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBACa,eAAgB,SAAQ,cAAc;IACjD,MAAM,CAAC,MAAM,4BAA0B;IAEvC;;;;OAIG;IAEH,UAAU,UAAQ;IAElB;;;;OAIG;IAEH,OAAO,CAAC,MAAM,CAAwB;IAEtC;;OAEG;IACH,OAAO,CAAC,kCAAkC;cAM1B,UAAU;IAI1B;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,eAAe;IAIpC,SAAS,CAAC,OAAO,CACf,iBAAiB,EAAE,cAAc,CAAC,iCAAiC,CAAC;IA8BtE;;;;OAIG;IACH,OAAO,KAAK,WAAW,GAQtB;IAED,SAAS,CAAC,MAAM,IAAI,cAAc;CAoBnC"}
@@ -1,52 +0,0 @@
1
- import { LitElement } from 'lit';
2
- import { InlineEditMode } from './inline-edit.types';
3
- export declare abstract class InlineEditBase extends LitElement {
4
- /**
5
- * When a field or group is locked it cannot enter edit mode.
6
- */
7
- locked: boolean;
8
- /**
9
- * Function to invoke when the Save button is clicked for a field or group.
10
- *
11
- * When a field is controlled by a group, field-level save functions are
12
- * ignored and the group save function always runs.
13
- *
14
- * When a field is within a group but uncontrolled, or outside of a group, it
15
- * looks for a field-level function first before running a group function.
16
- */
17
- save?: () => Promise<void>;
18
- /**
19
- * The current mode of the field or group.
20
- *
21
- * @internal
22
- */
23
- protected mode: InlineEditMode;
24
- /**
25
- * Switches the field to edit mode.
26
- */
27
- private setEditMode;
28
- /**
29
- * Switches the field to read mode.
30
- */
31
- private setReadMode;
32
- /**
33
- * Switches the field to saving mode.
34
- */
35
- private setSavingMode;
36
- private setErrorMode;
37
- /**
38
- * Switches the field to saved mode. Automatically reverts to read mode after
39
- * 5 seconds.
40
- */
41
- private setSavedMode;
42
- /**
43
- * Calls the setter for the target mode passed in. Since this method is shared
44
- * by both fields and groups, it is particularly useful for syncing field
45
- * modes with the group mode.
46
- */
47
- setMode(newMode: InlineEditMode): void;
48
- protected abstract handleSave(): Promise<void>;
49
- protected handleSaveClick(): Promise<void>;
50
- protected handleCancelClick(): void;
51
- }
52
- //# sourceMappingURL=inline-edit.base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-edit.base.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-edit/inline-edit.base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,8BAAsB,cAAe,SAAQ,UAAU;IACrD;;OAEG;IAEH,MAAM,UAAQ;IAEd;;;;;;;;OAQG;IAEH,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1B;;;;OAIG;IAEH,SAAS,CAAC,IAAI,EAAE,cAAc,CAAS;IAEvC;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACH,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,YAAY;IAMpB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,cAAc;IAoB/B,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;cAE9B,eAAe;IAY/B,SAAS,CAAC,iBAAiB;CAG5B"}
@@ -1,6 +0,0 @@
1
- export declare const INLINE_EDIT_FIELD: "brz-inline-edit-field";
2
- export declare const INLINE_EDIT_GROUP: "brz-inline-edit-group";
3
- export declare const INLINE_EDIT_CONTROLS: "brz-inline-edit-controls";
4
- export declare const inlineEditControlsModes: readonly ["edit", "saving", "error"];
5
- export declare const inlineEditModes: readonly ["read", "saved", "edit", "saving", "error"];
6
- //# sourceMappingURL=inline-edit.const.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-edit.const.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-edit/inline-edit.const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,yBAAyC,CAAA;AACvE,eAAO,MAAM,iBAAiB,yBAAyC,CAAA;AACvE,eAAO,MAAM,oBAAoB,4BAA4C,CAAA;AAE7E,eAAO,MAAM,uBAAuB,sCAAuC,CAAA;AAE3E,eAAO,MAAM,eAAe,uDAIlB,CAAA"}
@@ -1,32 +0,0 @@
1
- import type { InlineEditField } from './inline-edit-field';
2
- import type { InlineEditGroup } from './inline-edit-group';
3
- import type { InlineEditMode } from './inline-edit.types';
4
- export declare class InlineEditControlsCancelEvent<Detail = unknown> extends CustomEvent<Detail> {
5
- constructor(options?: CustomEventInit<Detail>);
6
- }
7
- export declare class InlineEditControlsSaveEvent<Detail = unknown> extends CustomEvent<Detail> {
8
- constructor(options?: CustomEventInit<Detail>);
9
- }
10
- export declare class InlineEditFieldBroadcastEvent<Detail = {
11
- element: InlineEditField;
12
- currentMode: InlineEditMode;
13
- }> extends CustomEvent<Detail> {
14
- constructor(options?: CustomEventInit<Detail>);
15
- }
16
- export declare class InlineEditFieldModeChangeEvent<Detail = {
17
- element: InlineEditField;
18
- currentMode: InlineEditMode;
19
- previousMode: InlineEditMode;
20
- group: InlineEditGroup | null;
21
- }> extends CustomEvent<Detail> {
22
- constructor(options?: CustomEventInit<Detail>);
23
- }
24
- export declare class InlineEditGroupModeChangeEvent<Detail = {
25
- currentMode: InlineEditMode;
26
- previousMode: InlineEditMode;
27
- group: InlineEditGroup;
28
- fields: InlineEditField[];
29
- }> extends CustomEvent<Detail> {
30
- constructor(options?: CustomEventInit<Detail>);
31
- }
32
- //# sourceMappingURL=inline-edit.events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-edit.events.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-edit/inline-edit.events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,qBAAa,6BAA6B,CACxC,MAAM,GAAG,OAAO,CAChB,SAAQ,WAAW,CAAC,MAAM,CAAC;gBACf,OAAO,GAAE,eAAe,CAAC,MAAM,CAAM;CAOlD;AAED,qBAAa,2BAA2B,CACtC,MAAM,GAAG,OAAO,CAChB,SAAQ,WAAW,CAAC,MAAM,CAAC;gBACf,OAAO,GAAE,eAAe,CAAC,MAAM,CAAM;CAOlD;AAED,qBAAa,6BAA6B,CACxC,MAAM,GAAG;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,cAAc,CAAA;CAAE,CAClE,SAAQ,WAAW,CAAC,MAAM,CAAC;gBACf,OAAO,GAAE,eAAe,CAAC,MAAM,CAAM;CAOlD;AAED,qBAAa,8BAA8B,CACzC,MAAM,GAAG;IACP,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,EAAE,cAAc,CAAA;IAC3B,YAAY,EAAE,cAAc,CAAA;IAC5B,KAAK,EAAE,eAAe,GAAG,IAAI,CAAA;CAC9B,CACD,SAAQ,WAAW,CAAC,MAAM,CAAC;gBACf,OAAO,GAAE,eAAe,CAAC,MAAM,CAAM;CAOlD;AAED,qBAAa,8BAA8B,CACzC,MAAM,GAAG;IACP,WAAW,EAAE,cAAc,CAAA;IAC3B,YAAY,EAAE,cAAc,CAAA;IAC5B,KAAK,EAAE,eAAe,CAAA;IACtB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B,CACD,SAAQ,WAAW,CAAC,MAAM,CAAC;gBACf,OAAO,GAAE,eAAe,CAAC,MAAM,CAAM;CAOlD"}
@@ -1,4 +0,0 @@
1
- export declare const inlineEditFieldStyles: import("lit").CSSResult;
2
- export declare const inlineEditGroupStyles: import("lit").CSSResult;
3
- export declare const inlineEditControlsStyles: import("lit").CSSResult;
4
- //# sourceMappingURL=inline-edit.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-edit.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-edit/inline-edit.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,yBA0FjC,CAAA;AAED,eAAO,MAAM,qBAAqB,yBAWjC,CAAA;AAED,eAAO,MAAM,wBAAwB,yBAQpC,CAAA"}
@@ -1,45 +0,0 @@
1
- import { InlineEditControls } from './inline-edit-controls';
2
- import { InlineEditField } from './inline-edit-field';
3
- import { InlineEditGroup } from './inline-edit-group';
4
- import { INLINE_EDIT_CONTROLS, INLINE_EDIT_FIELD, INLINE_EDIT_GROUP, inlineEditControlsModes, inlineEditModes } from './inline-edit.const';
5
- import type { JSXProps } from '../../types';
6
- export type InlineEditMode = typeof inlineEditModes[number];
7
- export type InlineEditControlsMode = typeof inlineEditControlsModes[number];
8
- export interface InlineEditBaseReactiveProperties {
9
- locked: boolean;
10
- mode: InlineEditMode;
11
- save: () => Promise<void>;
12
- }
13
- export type InlineEditBaseProps = Pick<Partial<InlineEditBaseReactiveProperties>, 'locked' | 'save'>;
14
- export interface InlineEditFieldReactiveProperties extends InlineEditBaseReactiveProperties {
15
- controlled: boolean;
16
- truncate: boolean;
17
- }
18
- export type InlineEditFieldProps = InlineEditBaseProps & Partial<InlineEditFieldReactiveProperties>;
19
- export interface InlineEditGroupReactiveProperties extends InlineEditBaseReactiveProperties {
20
- controller: boolean;
21
- fields: InlineEditField[];
22
- }
23
- export type InlineEditGroupProps = InlineEditBaseProps & Pick<Partial<InlineEditGroupReactiveProperties>, 'controller'>;
24
- export interface InlineEditControlsProps {
25
- mode?: InlineEditControlsMode;
26
- }
27
- export interface FieldOption<ValueType = unknown> {
28
- label: string;
29
- value: ValueType;
30
- }
31
- declare global {
32
- namespace JSX {
33
- interface IntrinsicElements {
34
- [INLINE_EDIT_CONTROLS]: JSXProps<InlineEditControls, InlineEditControlsProps>;
35
- [INLINE_EDIT_FIELD]: JSXProps<InlineEditField, InlineEditFieldProps>;
36
- [INLINE_EDIT_GROUP]: JSXProps<InlineEditGroup, InlineEditGroupProps>;
37
- }
38
- }
39
- interface HTMLElementTagNameMap {
40
- [INLINE_EDIT_CONTROLS]: InlineEditControls;
41
- [INLINE_EDIT_FIELD]: InlineEditField;
42
- [INLINE_EDIT_GROUP]: InlineEditGroup;
43
- }
44
- }
45
- //# sourceMappingURL=inline-edit.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-edit.types.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-edit/inline-edit.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;AAE3D,MAAM,MAAM,sBAAsB,GAAG,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAA;AAE3E,MAAM,WAAW,gCAAgC;IAC/C,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,cAAc,CAAA;IACpB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B;AAED,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,OAAO,CAAC,gCAAgC,CAAC,EACzC,QAAQ,GAAG,MAAM,CAClB,CAAA;AAED,MAAM,WAAW,iCACf,SAAQ,gCAAgC;IACxC,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GACpD,OAAO,CAAC,iCAAiC,CAAC,CAAA;AAE5C,MAAM,WAAW,iCACf,SAAQ,gCAAgC;IACxC,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B;AAED,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GACpD,IAAI,CAAC,OAAO,CAAC,iCAAiC,CAAC,EAAE,YAAY,CAAC,CAAA;AAEhE,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,sBAAsB,CAAA;CAC9B;AAED,MAAM,WAAW,WAAW,CAAC,SAAS,GAAG,OAAO;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;CACjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,CAAC,oBAAoB,CAAC,EAAE,QAAQ,CAC9B,kBAAkB,EAClB,uBAAuB,CACxB,CAAA;YACD,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAA;YACpE,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAA;SACrE;KACF;IAED,UAAU,qBAAqB;QAC7B,CAAC,oBAAoB,CAAC,EAAE,kBAAkB,CAAA;QAC1C,CAAC,iBAAiB,CAAC,EAAE,eAAe,CAAA;QACpC,CAAC,iBAAiB,CAAC,EAAE,eAAe,CAAA;KACrC;CACF"}