valtech-components 2.0.404 → 2.0.407
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -0
- package/esm2022/lib/components/atoms/avatar/avatar.component.mjs +4 -4
- package/esm2022/lib/components/atoms/avatar/types.mjs +1 -1
- package/esm2022/lib/components/atoms/box/box.component.mjs +4 -4
- package/esm2022/lib/components/atoms/box/types.mjs +1 -1
- package/esm2022/lib/components/atoms/button/button.component.mjs +6 -6
- package/esm2022/lib/components/atoms/button/factory.mjs +1 -1
- package/esm2022/lib/components/atoms/countdown/countdown.component.mjs +343 -0
- package/esm2022/lib/components/atoms/countdown/types.mjs +27 -0
- package/esm2022/lib/components/atoms/display/display.component.mjs +4 -4
- package/esm2022/lib/components/atoms/display/types.mjs +1 -1
- package/esm2022/lib/components/atoms/divider/divider.component.mjs +4 -4
- package/esm2022/lib/components/atoms/divider/types.mjs +1 -1
- package/esm2022/lib/components/atoms/fab/fab.component.mjs +152 -0
- package/esm2022/lib/components/atoms/fab/types.mjs +2 -0
- package/esm2022/lib/components/atoms/href/href.component.mjs +4 -4
- package/esm2022/lib/components/atoms/href/types.mjs +1 -1
- package/esm2022/lib/components/atoms/icon/icon.component.mjs +4 -4
- package/esm2022/lib/components/atoms/icon/types.mjs +1 -1
- package/esm2022/lib/components/atoms/image/image.component.mjs +6 -6
- package/esm2022/lib/components/atoms/image/types.mjs +1 -1
- package/esm2022/lib/components/atoms/price-tag/price-tag.component.mjs +245 -0
- package/esm2022/lib/components/atoms/price-tag/types.mjs +15 -0
- package/esm2022/lib/components/atoms/progress-bar/progress-bar.component.mjs +4 -4
- package/esm2022/lib/components/atoms/progress-bar/types.mjs +1 -1
- package/esm2022/lib/components/atoms/progress-ring/progress-ring.component.mjs +149 -0
- package/esm2022/lib/components/atoms/progress-ring/types.mjs +2 -0
- package/esm2022/lib/components/atoms/qr-code/qr-code.component.mjs +417 -0
- package/esm2022/lib/components/atoms/qr-code/types.mjs +2 -0
- package/esm2022/lib/components/atoms/skeleton/skeleton.component.mjs +193 -0
- package/esm2022/lib/components/atoms/skeleton/types.mjs +13 -0
- package/esm2022/lib/components/atoms/text/text.component.mjs +4 -4
- package/esm2022/lib/components/atoms/text/types.mjs +1 -1
- package/esm2022/lib/components/atoms/title/title.component.mjs +4 -4
- package/esm2022/lib/components/atoms/title/types.mjs +1 -1
- package/esm2022/lib/components/molecules/accordion/accordion.component.mjs +139 -0
- package/esm2022/lib/components/molecules/accordion/types.mjs +2 -0
- package/esm2022/lib/components/molecules/action-header/action-header.component.mjs +4 -4
- package/esm2022/lib/components/molecules/action-header/types.mjs +1 -1
- package/esm2022/lib/components/molecules/alert-box/alert-box.component.mjs +4 -4
- package/esm2022/lib/components/molecules/alert-box/types.mjs +1 -1
- package/esm2022/lib/components/molecules/breadcrumb/breadcrumb.component.mjs +137 -0
- package/esm2022/lib/components/molecules/breadcrumb/types.mjs +2 -0
- package/esm2022/lib/components/molecules/button-group/button-group.component.mjs +4 -4
- package/esm2022/lib/components/molecules/button-group/types.mjs +1 -1
- package/esm2022/lib/components/molecules/card/card.component.mjs +5 -5
- package/esm2022/lib/components/molecules/card/types.mjs +1 -1
- package/esm2022/lib/components/molecules/check-input/check-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/chip-group/chip-group.component.mjs +174 -0
- package/esm2022/lib/components/molecules/chip-group/types.mjs +2 -0
- package/esm2022/lib/components/molecules/code-display/code-display.component.mjs +4 -4
- package/esm2022/lib/components/molecules/code-display/types.mjs +1 -1
- package/esm2022/lib/components/molecules/command-display/command-display.component.mjs +4 -4
- package/esm2022/lib/components/molecules/command-display/types.mjs +1 -1
- package/esm2022/lib/components/molecules/comment/comment.component.mjs +634 -0
- package/esm2022/lib/components/molecules/comment/types.mjs +2 -0
- package/esm2022/lib/components/molecules/comment-input/comment-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/content-loader/content-loader.component.mjs +4 -4
- package/esm2022/lib/components/molecules/content-loader/types.mjs +1 -1
- package/esm2022/lib/components/molecules/currency-input/currency-input.component.mjs +368 -0
- package/esm2022/lib/components/molecules/currency-input/types.mjs +18 -0
- package/esm2022/lib/components/molecules/date-input/date-input.component.mjs +5 -5
- package/esm2022/lib/components/molecules/date-range-input/date-range-input.component.mjs +418 -0
- package/esm2022/lib/components/molecules/date-range-input/types.mjs +2 -0
- package/esm2022/lib/components/molecules/email-input/email-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/expandable-text/expandable-text.component.mjs +4 -4
- package/esm2022/lib/components/molecules/expandable-text/types.mjs +1 -1
- package/esm2022/lib/components/molecules/file-input/file-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/glow-card/glow-card.component.mjs +279 -0
- package/esm2022/lib/components/molecules/glow-card/types.mjs +11 -0
- package/esm2022/lib/components/molecules/hint/hint.component.mjs +4 -4
- package/esm2022/lib/components/molecules/hour-input/hour-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/info/info.component.mjs +4 -4
- package/esm2022/lib/components/molecules/info/types.mjs +1 -1
- package/esm2022/lib/components/molecules/language-selector/language-selector.component.mjs +4 -4
- package/esm2022/lib/components/molecules/language-selector/types.mjs +1 -1
- package/esm2022/lib/components/molecules/layered-card/layered-card.component.mjs +4 -4
- package/esm2022/lib/components/molecules/layered-card/types.mjs +1 -1
- package/esm2022/lib/components/molecules/link/link.component.mjs +4 -4
- package/esm2022/lib/components/molecules/link/types.mjs +1 -1
- package/esm2022/lib/components/molecules/links-cake/links-cake.component.mjs +4 -4
- package/esm2022/lib/components/molecules/links-cake/types.mjs +1 -1
- package/esm2022/lib/components/molecules/multi-select-search/multi-select-search.component.mjs +5 -5
- package/esm2022/lib/components/molecules/notes-box/notes-box.component.mjs +4 -4
- package/esm2022/lib/components/molecules/notes-box/types.mjs +1 -1
- package/esm2022/lib/components/molecules/number-from-to/number-from-to.component.mjs +4 -4
- package/esm2022/lib/components/molecules/number-input/number-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/number-stepper/number-stepper.component.mjs +377 -0
- package/esm2022/lib/components/molecules/number-stepper/types.mjs +2 -0
- package/esm2022/lib/components/molecules/pagination/pagination.component.mjs +253 -0
- package/esm2022/lib/components/molecules/pagination/types.mjs +2 -0
- package/esm2022/lib/components/molecules/participant-card/participant-card.component.mjs +486 -0
- package/esm2022/lib/components/molecules/participant-card/types.mjs +21 -0
- package/esm2022/lib/components/molecules/password-input/password-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/phone-input/phone-input.component.mjs +336 -0
- package/esm2022/lib/components/molecules/phone-input/types.mjs +19 -0
- package/esm2022/lib/components/molecules/pill/pill.component.mjs +4 -4
- package/esm2022/lib/components/molecules/pill/types.mjs +1 -1
- package/esm2022/lib/components/molecules/pin-input/pin-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/plain-code-box/plain-code-box.component.mjs +4 -4
- package/esm2022/lib/components/molecules/plain-code-box/types.mjs +1 -1
- package/esm2022/lib/components/molecules/popover-selector/popover-selector.component.mjs +5 -5
- package/esm2022/lib/components/molecules/popover-selector/types.mjs +1 -1
- package/esm2022/lib/components/molecules/progress-status/progress-status.component.mjs +4 -4
- package/esm2022/lib/components/molecules/progress-status/types.mjs +1 -1
- package/esm2022/lib/components/molecules/prompter/prompter.component.mjs +4 -4
- package/esm2022/lib/components/molecules/prompter/types.mjs +1 -1
- package/esm2022/lib/components/molecules/quote-box/quote-box.component.mjs +155 -0
- package/esm2022/lib/components/molecules/radio-input/radio-input.component.mjs +5 -5
- package/esm2022/lib/components/molecules/raffle-status-card/raffle-status-card.component.mjs +484 -0
- package/esm2022/lib/components/molecules/raffle-status-card/types.mjs +23 -0
- package/esm2022/lib/components/molecules/range-input/range-input.component.mjs +148 -0
- package/esm2022/lib/components/molecules/range-input/types.mjs +2 -0
- package/esm2022/lib/components/molecules/rating/rating.component.mjs +149 -0
- package/esm2022/lib/components/molecules/rating/types.mjs +2 -0
- package/esm2022/lib/components/molecules/searchbar/searchbar.component.mjs +4 -4
- package/esm2022/lib/components/molecules/segment-control/segment-control.component.mjs +145 -0
- package/esm2022/lib/components/molecules/segment-control/types.mjs +2 -0
- package/esm2022/lib/components/molecules/select-input/select-input.component.mjs +5 -5
- package/esm2022/lib/components/molecules/select-search/select-search.component.mjs +5 -5
- package/esm2022/lib/components/molecules/share-buttons/share-buttons.component.mjs +277 -0
- package/esm2022/lib/components/molecules/share-buttons/types.mjs +88 -0
- package/esm2022/lib/components/molecules/stats-card/stats-card.component.mjs +165 -0
- package/esm2022/lib/components/molecules/stats-card/types.mjs +2 -0
- package/esm2022/lib/components/molecules/stepper/stepper.component.mjs +239 -0
- package/esm2022/lib/components/molecules/stepper/types.mjs +2 -0
- package/esm2022/lib/components/molecules/tabs/tabs.component.mjs +135 -0
- package/esm2022/lib/components/molecules/tabs/types.mjs +2 -0
- package/esm2022/lib/components/molecules/text-input/text-input.component.mjs +4 -4
- package/esm2022/lib/components/molecules/textarea-input/textarea-input.component.mjs +204 -0
- package/esm2022/lib/components/molecules/textarea-input/types.mjs +2 -0
- package/esm2022/lib/components/molecules/ticket-grid/ticket-grid.component.mjs +497 -0
- package/esm2022/lib/components/molecules/ticket-grid/types.mjs +11 -0
- package/esm2022/lib/components/molecules/timeline/timeline.component.mjs +140 -0
- package/esm2022/lib/components/molecules/timeline/types.mjs +2 -0
- package/esm2022/lib/components/molecules/title-block/title-block.component.mjs +4 -4
- package/esm2022/lib/components/molecules/title-block/types.mjs +1 -1
- package/esm2022/lib/components/molecules/toggle-input/toggle-input.component.mjs +89 -0
- package/esm2022/lib/components/molecules/toggle-input/types.mjs +2 -0
- package/esm2022/lib/components/molecules/winner-display/types.mjs +9 -0
- package/esm2022/lib/components/molecules/winner-display/winner-display.component.mjs +370 -0
- package/esm2022/lib/components/organisms/article/article.component.mjs +4 -4
- package/esm2022/lib/components/organisms/article/types.mjs +1 -1
- package/esm2022/lib/components/organisms/banner/banner.component.mjs +4 -4
- package/esm2022/lib/components/organisms/banner/types.mjs +1 -1
- package/esm2022/lib/components/organisms/comment-section/comment-section.component.mjs +578 -0
- package/esm2022/lib/components/organisms/comment-section/types.mjs +2 -0
- package/esm2022/lib/components/organisms/data-table/data-table.component.mjs +853 -0
- package/esm2022/lib/components/organisms/data-table/types.mjs +13 -0
- package/esm2022/lib/components/organisms/footer/footer.component.mjs +4 -4
- package/esm2022/lib/components/organisms/footer/types.mjs +1 -1
- package/esm2022/lib/components/organisms/form/factory.mjs +1 -1
- package/esm2022/lib/components/organisms/form/form-footer/form-footer.component.mjs +4 -4
- package/esm2022/lib/components/organisms/form/form.component.mjs +4 -4
- package/esm2022/lib/components/organisms/header/header.component.mjs +4 -4
- package/esm2022/lib/components/organisms/header/types.mjs +1 -1
- package/esm2022/lib/components/organisms/item-list/item-list.component.mjs +4 -4
- package/esm2022/lib/components/organisms/item-list/types.mjs +1 -1
- package/esm2022/lib/components/organisms/no-content/no-content.component.mjs +4 -4
- package/esm2022/lib/components/organisms/no-content/types.mjs +1 -1
- package/esm2022/lib/components/organisms/toolbar/toolbar.component.mjs +4 -4
- package/esm2022/lib/components/organisms/toolbar/types.mjs +1 -1
- package/esm2022/lib/components/organisms/wizard/types.mjs +1 -1
- package/esm2022/lib/components/organisms/wizard/wizard-footer/wizard-footer.component.mjs +4 -4
- package/esm2022/lib/components/organisms/wizard/wizard.component.mjs +4 -4
- package/esm2022/lib/components/templates/layout/layout.component.mjs +4 -4
- package/esm2022/lib/components/templates/simple/simple.component.mjs +5 -5
- package/esm2022/lib/components/templates/simple/types.mjs +1 -1
- package/esm2022/lib/components/types.mjs +22 -16
- package/esm2022/lib/services/confirmation-dialog/confirmation-dialog.service.mjs +180 -0
- package/esm2022/lib/services/confirmation-dialog/types.mjs +14 -0
- package/esm2022/lib/services/download.service.mjs +4 -4
- package/esm2022/lib/services/icons.service.mjs +4 -4
- package/esm2022/lib/services/in-app-browser.service.mjs +4 -4
- package/esm2022/lib/services/lang-provider/components/lang-settings.mjs +1 -1
- package/esm2022/lib/services/lang-provider/content.mjs +1 -1
- package/esm2022/lib/services/lang-provider/lang-provider.service.mjs +4 -4
- package/esm2022/lib/services/lang-provider/types.mjs +1 -1
- package/esm2022/lib/services/link-processor.service.mjs +4 -4
- package/esm2022/lib/services/local-storage.service.mjs +1 -1
- package/esm2022/lib/services/modal/modal.service.mjs +213 -0
- package/esm2022/lib/services/modal/simple-modal-content.component.mjs +133 -0
- package/esm2022/lib/services/modal/types.mjs +26 -0
- package/esm2022/lib/services/navigation.service.mjs +4 -4
- package/esm2022/lib/services/qr-generator/qr-generator.service.mjs +341 -0
- package/esm2022/lib/services/qr-generator/types.mjs +46 -0
- package/esm2022/lib/services/theme.service.mjs +4 -4
- package/esm2022/lib/services/toast.service.mjs +4 -4
- package/esm2022/lib/services/types.mjs +1 -1
- package/esm2022/lib/shared/constants/storage.mjs +1 -1
- package/esm2022/lib/shared/pipes/process-links.pipe.mjs +4 -4
- package/esm2022/lib/shared/utils/content.mjs +1 -1
- package/esm2022/lib/shared/utils/dom.mjs +1 -1
- package/esm2022/lib/shared/utils/form-defaults.mjs +1 -1
- package/esm2022/lib/shared/utils/simple-content.mjs +1 -1
- package/esm2022/lib/shared/utils/styles.mjs +1 -1
- package/esm2022/lib/shared/utils/text.mjs +1 -1
- package/esm2022/public-api.mjs +73 -3
- package/esm2022/valtech-components.mjs +1 -1
- package/fesm2022/valtech-components-simple-modal-content.component-DQhEgUmS.mjs +136 -0
- package/fesm2022/valtech-components-simple-modal-content.component-DQhEgUmS.mjs.map +1 -0
- package/fesm2022/valtech-components.mjs +14848 -4293
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/countdown/countdown.component.d.ts +38 -0
- package/lib/components/atoms/countdown/types.d.ts +108 -0
- package/lib/components/atoms/fab/fab.component.d.ts +16 -0
- package/lib/components/atoms/fab/types.d.ts +45 -0
- package/lib/components/atoms/price-tag/price-tag.component.d.ts +16 -0
- package/lib/components/atoms/price-tag/types.d.ts +59 -0
- package/lib/components/atoms/progress-ring/progress-ring.component.d.ts +20 -0
- package/lib/components/atoms/progress-ring/types.d.ts +24 -0
- package/lib/components/atoms/qr-code/qr-code.component.d.ts +36 -0
- package/lib/components/atoms/qr-code/types.d.ts +124 -0
- package/lib/components/atoms/skeleton/skeleton.component.d.ts +12 -0
- package/lib/components/atoms/skeleton/types.d.ts +29 -0
- package/lib/components/molecules/accordion/accordion.component.d.ts +19 -0
- package/lib/components/molecules/accordion/types.d.ts +47 -0
- package/lib/components/molecules/breadcrumb/breadcrumb.component.d.ts +22 -0
- package/lib/components/molecules/breadcrumb/types.d.ts +45 -0
- package/lib/components/molecules/chip-group/chip-group.component.d.ts +22 -0
- package/lib/components/molecules/chip-group/types.d.ts +65 -0
- package/lib/components/molecules/comment/comment.component.d.ts +42 -0
- package/lib/components/molecules/comment/types.d.ts +171 -0
- package/lib/components/molecules/currency-input/currency-input.component.d.ts +43 -0
- package/lib/components/molecules/currency-input/types.d.ts +96 -0
- package/lib/components/molecules/date-range-input/date-range-input.component.d.ts +42 -0
- package/lib/components/molecules/date-range-input/types.d.ts +109 -0
- package/lib/components/molecules/glow-card/glow-card.component.d.ts +51 -0
- package/lib/components/molecules/glow-card/types.d.ts +92 -0
- package/lib/components/molecules/number-stepper/number-stepper.component.d.ts +34 -0
- package/lib/components/molecules/number-stepper/types.d.ts +88 -0
- package/lib/components/molecules/pagination/pagination.component.d.ts +15 -0
- package/lib/components/molecules/pagination/types.d.ts +41 -0
- package/lib/components/molecules/participant-card/participant-card.component.d.ts +26 -0
- package/lib/components/molecules/participant-card/types.d.ts +132 -0
- package/lib/components/molecules/phone-input/phone-input.component.d.ts +38 -0
- package/lib/components/molecules/phone-input/types.d.ts +98 -0
- package/lib/components/molecules/quote-box/quote-box.component.d.ts +26 -0
- package/lib/components/molecules/raffle-status-card/raffle-status-card.component.d.ts +22 -0
- package/lib/components/molecules/raffle-status-card/types.d.ts +108 -0
- package/lib/components/molecules/range-input/range-input.component.d.ts +30 -0
- package/lib/components/molecules/range-input/types.d.ts +59 -0
- package/lib/components/molecules/rating/rating.component.d.ts +17 -0
- package/lib/components/molecules/rating/types.d.ts +41 -0
- package/lib/components/molecules/segment-control/segment-control.component.d.ts +30 -0
- package/lib/components/molecules/segment-control/types.d.ts +46 -0
- package/lib/components/molecules/share-buttons/share-buttons.component.d.ts +22 -0
- package/lib/components/molecules/share-buttons/types.d.ts +108 -0
- package/lib/components/molecules/stats-card/stats-card.component.d.ts +14 -0
- package/lib/components/molecules/stats-card/types.d.ts +41 -0
- package/lib/components/molecules/stepper/stepper.component.d.ts +21 -0
- package/lib/components/molecules/stepper/types.d.ts +66 -0
- package/lib/components/molecules/tabs/tabs.component.d.ts +17 -0
- package/lib/components/molecules/tabs/types.d.ts +45 -0
- package/lib/components/molecules/textarea-input/textarea-input.component.d.ts +27 -0
- package/lib/components/molecules/textarea-input/types.d.ts +74 -0
- package/lib/components/molecules/ticket-grid/ticket-grid.component.d.ts +41 -0
- package/lib/components/molecules/ticket-grid/types.d.ts +122 -0
- package/lib/components/molecules/timeline/timeline.component.d.ts +14 -0
- package/lib/components/molecules/timeline/types.d.ts +39 -0
- package/lib/components/molecules/toggle-input/toggle-input.component.d.ts +24 -0
- package/lib/components/molecules/toggle-input/types.d.ts +30 -0
- package/lib/components/molecules/winner-display/types.d.ts +103 -0
- package/lib/components/molecules/winner-display/winner-display.component.d.ts +37 -0
- package/lib/components/organisms/article/article.component.d.ts +1 -1
- package/lib/components/organisms/comment-section/comment-section.component.d.ts +52 -0
- package/lib/components/organisms/comment-section/types.d.ts +144 -0
- package/lib/components/organisms/data-table/data-table.component.d.ts +46 -0
- package/lib/components/organisms/data-table/types.d.ts +205 -0
- package/lib/components/types.d.ts +21 -15
- package/lib/services/confirmation-dialog/confirmation-dialog.service.d.ts +71 -0
- package/lib/services/confirmation-dialog/types.d.ts +61 -0
- package/lib/services/modal/modal.service.d.ts +98 -0
- package/lib/services/modal/simple-modal-content.component.d.ts +19 -0
- package/lib/services/modal/types.d.ts +155 -0
- package/lib/services/qr-generator/qr-generator.service.d.ts +115 -0
- package/lib/services/qr-generator/types.d.ts +141 -0
- package/package.json +11 -4
- package/public-api.d.ts +72 -2
- package/LICENSE +0 -21
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Color } from '@ionic/core';
|
|
2
|
+
import { CommentMetadata, CommentAuthor } from '../../molecules/comment/types';
|
|
3
|
+
/**
|
|
4
|
+
* Sort/filter option for comments.
|
|
5
|
+
* The actual sorting logic is handled by the parent component.
|
|
6
|
+
*/
|
|
7
|
+
export interface CommentSortOption {
|
|
8
|
+
/** Unique identifier */
|
|
9
|
+
token: string;
|
|
10
|
+
/** Display label */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Optional icon */
|
|
13
|
+
icon?: string;
|
|
14
|
+
/** Reactive content key */
|
|
15
|
+
contentKey?: string;
|
|
16
|
+
/** Component class for content lookup */
|
|
17
|
+
contentClass?: string;
|
|
18
|
+
/** Fallback label */
|
|
19
|
+
contentFallback?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Configuration for the new comment input area.
|
|
23
|
+
*/
|
|
24
|
+
export interface CommentInputConfig {
|
|
25
|
+
/** Input placeholder text */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/** Submit button label */
|
|
28
|
+
submitLabel?: string;
|
|
29
|
+
/** Current user info (for avatar display) */
|
|
30
|
+
currentUser?: CommentAuthor;
|
|
31
|
+
/** Maximum character length */
|
|
32
|
+
maxLength?: number;
|
|
33
|
+
/** Minimum character length to enable submit */
|
|
34
|
+
minLength?: number;
|
|
35
|
+
/** Whether input is disabled */
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/** Submit button color */
|
|
38
|
+
submitColor?: Color;
|
|
39
|
+
/** Show character counter */
|
|
40
|
+
showCounter?: boolean;
|
|
41
|
+
/** Reactive content keys */
|
|
42
|
+
placeholderContentKey?: string;
|
|
43
|
+
submitLabelContentKey?: string;
|
|
44
|
+
contentClass?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Empty state configuration when no comments exist.
|
|
48
|
+
*/
|
|
49
|
+
export interface CommentEmptyState {
|
|
50
|
+
/** Empty state title */
|
|
51
|
+
title?: string;
|
|
52
|
+
/** Empty state message */
|
|
53
|
+
message?: string;
|
|
54
|
+
/** Empty state icon */
|
|
55
|
+
icon?: string;
|
|
56
|
+
/** Reactive content keys */
|
|
57
|
+
titleContentKey?: string;
|
|
58
|
+
messageContentKey?: string;
|
|
59
|
+
contentClass?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Main metadata for comment-section organism.
|
|
63
|
+
*/
|
|
64
|
+
export interface CommentSectionMetadata {
|
|
65
|
+
/** Unique section identifier */
|
|
66
|
+
token?: string;
|
|
67
|
+
/** Section title (e.g., "Comments", "Reviews") */
|
|
68
|
+
title?: string;
|
|
69
|
+
/** Total comment count (may differ from comments.length if paginated) */
|
|
70
|
+
count?: number;
|
|
71
|
+
/** Whether to show the count badge */
|
|
72
|
+
showCount?: boolean;
|
|
73
|
+
/** Available sort options */
|
|
74
|
+
sortOptions?: CommentSortOption[];
|
|
75
|
+
/** Currently selected sort option token */
|
|
76
|
+
selectedSort?: string;
|
|
77
|
+
/** Sort dropdown label */
|
|
78
|
+
sortLabel?: string;
|
|
79
|
+
/** Array of comments to display */
|
|
80
|
+
comments: CommentMetadata[];
|
|
81
|
+
/** Whether to show the new comment input */
|
|
82
|
+
showInput?: boolean;
|
|
83
|
+
/** Input configuration */
|
|
84
|
+
inputConfig?: CommentInputConfig;
|
|
85
|
+
/** Initial loading state */
|
|
86
|
+
loading?: boolean;
|
|
87
|
+
/** Loading more comments */
|
|
88
|
+
loadingMore?: boolean;
|
|
89
|
+
/** Number of skeleton items to show when loading */
|
|
90
|
+
skeletonCount?: number;
|
|
91
|
+
/** Whether there are more comments to load */
|
|
92
|
+
hasMore?: boolean;
|
|
93
|
+
/** Load more button label */
|
|
94
|
+
loadMoreLabel?: string;
|
|
95
|
+
/** Pagination mode: 'button' (default) or 'infinite' */
|
|
96
|
+
paginationMode?: 'button' | 'infinite';
|
|
97
|
+
/** Infinite scroll threshold (e.g., '100px', '15%') */
|
|
98
|
+
infiniteScrollThreshold?: string;
|
|
99
|
+
/** Infinite scroll position */
|
|
100
|
+
infiniteScrollPosition?: 'top' | 'bottom';
|
|
101
|
+
/** Empty state configuration */
|
|
102
|
+
emptyState?: CommentEmptyState;
|
|
103
|
+
/** Section color theme */
|
|
104
|
+
color?: Color;
|
|
105
|
+
/** Whether to show dividers between comments */
|
|
106
|
+
showDividers?: boolean;
|
|
107
|
+
/** Reactive content key for title */
|
|
108
|
+
titleContentKey?: string;
|
|
109
|
+
/** Component class for content lookup */
|
|
110
|
+
contentClass?: string;
|
|
111
|
+
/** Fallback title */
|
|
112
|
+
titleContentFallback?: string;
|
|
113
|
+
/** Reactive content key for load more label */
|
|
114
|
+
loadMoreContentKey?: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Event emitted when sort option changes.
|
|
118
|
+
*/
|
|
119
|
+
export interface CommentSortChangeEvent {
|
|
120
|
+
/** Selected sort option */
|
|
121
|
+
option: CommentSortOption;
|
|
122
|
+
/** Previous sort option token */
|
|
123
|
+
previousSort?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Event emitted when a new comment is submitted.
|
|
127
|
+
*/
|
|
128
|
+
export interface CommentSubmitEvent {
|
|
129
|
+
/** Comment text content */
|
|
130
|
+
content: string;
|
|
131
|
+
/** Parent comment token (if replying) */
|
|
132
|
+
parentToken?: string;
|
|
133
|
+
/** Section token */
|
|
134
|
+
sectionToken?: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Event emitted when load more is clicked.
|
|
138
|
+
*/
|
|
139
|
+
export interface CommentSectionLoadMoreEvent {
|
|
140
|
+
/** Section token */
|
|
141
|
+
sectionToken?: string;
|
|
142
|
+
/** Current loaded count */
|
|
143
|
+
currentCount: number;
|
|
144
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { DataTableMetadata, DataTableColumn, DataTableSort, DataTableRowClickEvent, DataTableSelectionChangeEvent, DataTableSortChangeEvent, DataTablePageChangeEvent } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DataTableComponent<T = any> implements OnInit, OnChanges {
|
|
5
|
+
props: DataTableMetadata<T>;
|
|
6
|
+
rowClick: EventEmitter<DataTableRowClickEvent<T>>;
|
|
7
|
+
selectionChange: EventEmitter<DataTableSelectionChangeEvent<T>>;
|
|
8
|
+
sortChange: EventEmitter<DataTableSortChangeEvent>;
|
|
9
|
+
pageChange: EventEmitter<DataTablePageChangeEvent>;
|
|
10
|
+
displayedData: T[];
|
|
11
|
+
currentSort: DataTableSort | null;
|
|
12
|
+
selectedRows: Set<any>;
|
|
13
|
+
private langService;
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
16
|
+
private initializeState;
|
|
17
|
+
private updateDisplayedData;
|
|
18
|
+
private sortData;
|
|
19
|
+
get visibleColumns(): DataTableColumn<T>[];
|
|
20
|
+
get totalColumns(): number;
|
|
21
|
+
get emptyState(): import("./types").DataTableEmptyState;
|
|
22
|
+
get pageSizeOptions(): number[];
|
|
23
|
+
get totalPages(): number;
|
|
24
|
+
get paginationStart(): number;
|
|
25
|
+
get paginationEnd(): number;
|
|
26
|
+
get isAllSelected(): boolean;
|
|
27
|
+
get isIndeterminate(): boolean;
|
|
28
|
+
getCellValue(row: T, column: DataTableColumn<T>): any;
|
|
29
|
+
getFormattedValue(row: T, column: DataTableColumn<T>): string;
|
|
30
|
+
getColumnClass(column: DataTableColumn<T>): string;
|
|
31
|
+
getAriaSort(column: DataTableColumn<T>): string | null;
|
|
32
|
+
getRowNumber(index: number): number;
|
|
33
|
+
getRowId(row: T): any;
|
|
34
|
+
trackByFn(row: T): any;
|
|
35
|
+
isRowSelected(row: T): boolean;
|
|
36
|
+
onSort(column: DataTableColumn<T>): void;
|
|
37
|
+
onRowClick(row: T, index: number, event: MouseEvent): void;
|
|
38
|
+
toggleSelectAll(event: CustomEvent): void;
|
|
39
|
+
toggleRowSelection(row: T, event: CustomEvent): void;
|
|
40
|
+
selectSingleRow(row: T): void;
|
|
41
|
+
private emitSelectionChange;
|
|
42
|
+
goToPage(page: number): void;
|
|
43
|
+
onPageSizeChange(event: CustomEvent): void;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataTableComponent<any>, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DataTableComponent<any>, "val-data-table", never, { "props": { "alias": "props"; "required": false; }; }, { "rowClick": "rowClick"; "selectionChange": "selectionChange"; "sortChange": "sortChange"; "pageChange": "pageChange"; }, never, never, true, never>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Color } from '@ionic/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
/**
|
|
4
|
+
* Column definition for the data table.
|
|
5
|
+
*/
|
|
6
|
+
export interface DataTableColumn<T = any> {
|
|
7
|
+
/** Unique identifier for the column */
|
|
8
|
+
key: string;
|
|
9
|
+
/** Header label */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Property path in the data object (supports dot notation) */
|
|
12
|
+
field?: string;
|
|
13
|
+
/** Column width (CSS value) */
|
|
14
|
+
width?: string;
|
|
15
|
+
/** Minimum width */
|
|
16
|
+
minWidth?: string;
|
|
17
|
+
/** Maximum width */
|
|
18
|
+
maxWidth?: string;
|
|
19
|
+
/** Text alignment */
|
|
20
|
+
align?: 'left' | 'center' | 'right';
|
|
21
|
+
/** Whether the column is sortable */
|
|
22
|
+
sortable?: boolean;
|
|
23
|
+
/** Custom sort function */
|
|
24
|
+
sortFn?: (a: T, b: T) => number;
|
|
25
|
+
/** Whether the column is visible */
|
|
26
|
+
visible?: boolean;
|
|
27
|
+
/** Custom cell template */
|
|
28
|
+
cellTemplate?: TemplateRef<any>;
|
|
29
|
+
/** Custom header template */
|
|
30
|
+
headerTemplate?: TemplateRef<any>;
|
|
31
|
+
/** Format function for cell value */
|
|
32
|
+
format?: (value: any, row: T) => string;
|
|
33
|
+
/** CSS class for the column */
|
|
34
|
+
cssClass?: string;
|
|
35
|
+
/** Whether this is a sticky column */
|
|
36
|
+
sticky?: 'start' | 'end';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Sort configuration.
|
|
40
|
+
*/
|
|
41
|
+
export interface DataTableSort {
|
|
42
|
+
/** Column key to sort by */
|
|
43
|
+
column: string;
|
|
44
|
+
/** Sort direction */
|
|
45
|
+
direction: 'asc' | 'desc';
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Pagination configuration.
|
|
49
|
+
*/
|
|
50
|
+
export interface DataTablePagination {
|
|
51
|
+
/** Current page (0-indexed) */
|
|
52
|
+
page: number;
|
|
53
|
+
/** Items per page */
|
|
54
|
+
pageSize: number;
|
|
55
|
+
/** Total number of items */
|
|
56
|
+
total: number;
|
|
57
|
+
/** Available page size options */
|
|
58
|
+
pageSizeOptions?: number[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Selection configuration.
|
|
62
|
+
*/
|
|
63
|
+
export interface DataTableSelection<T = any> {
|
|
64
|
+
/** Selection mode */
|
|
65
|
+
mode: 'none' | 'single' | 'multiple';
|
|
66
|
+
/** Currently selected items */
|
|
67
|
+
selected: T[];
|
|
68
|
+
/** Function to get unique ID from row */
|
|
69
|
+
trackBy?: (row: T) => any;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Row click event.
|
|
73
|
+
*/
|
|
74
|
+
export interface DataTableRowClickEvent<T = any> {
|
|
75
|
+
/** The row data */
|
|
76
|
+
row: T;
|
|
77
|
+
/** Row index */
|
|
78
|
+
index: number;
|
|
79
|
+
/** Original mouse event */
|
|
80
|
+
event: MouseEvent;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Selection change event.
|
|
84
|
+
*/
|
|
85
|
+
export interface DataTableSelectionChangeEvent<T = any> {
|
|
86
|
+
/** Selected rows */
|
|
87
|
+
selected: T[];
|
|
88
|
+
/** Row that was changed (if single change) */
|
|
89
|
+
changedRow?: T;
|
|
90
|
+
/** Action performed */
|
|
91
|
+
action: 'select' | 'deselect' | 'selectAll' | 'deselectAll';
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Sort change event.
|
|
95
|
+
*/
|
|
96
|
+
export interface DataTableSortChangeEvent {
|
|
97
|
+
/** Column key */
|
|
98
|
+
column: string;
|
|
99
|
+
/** Sort direction */
|
|
100
|
+
direction: 'asc' | 'desc' | null;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Page change event.
|
|
104
|
+
*/
|
|
105
|
+
export interface DataTablePageChangeEvent {
|
|
106
|
+
/** New page number */
|
|
107
|
+
page: number;
|
|
108
|
+
/** Page size */
|
|
109
|
+
pageSize: number;
|
|
110
|
+
/** Previous page */
|
|
111
|
+
previousPage: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Empty state configuration.
|
|
115
|
+
*/
|
|
116
|
+
export interface DataTableEmptyState {
|
|
117
|
+
/** Icon to display */
|
|
118
|
+
icon?: string;
|
|
119
|
+
/** Title text */
|
|
120
|
+
title?: string;
|
|
121
|
+
/** Description text */
|
|
122
|
+
description?: string;
|
|
123
|
+
/** Custom template */
|
|
124
|
+
template?: TemplateRef<any>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Loading state configuration.
|
|
128
|
+
*/
|
|
129
|
+
export interface DataTableLoadingState {
|
|
130
|
+
/** Whether data is loading */
|
|
131
|
+
loading: boolean;
|
|
132
|
+
/** Number of skeleton rows to show */
|
|
133
|
+
skeletonRows?: number;
|
|
134
|
+
/** Loading message */
|
|
135
|
+
message?: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Metadata for the data table component.
|
|
139
|
+
*/
|
|
140
|
+
export interface DataTableMetadata<T = any> {
|
|
141
|
+
/** Column definitions */
|
|
142
|
+
columns: DataTableColumn<T>[];
|
|
143
|
+
/** Data rows */
|
|
144
|
+
data: T[];
|
|
145
|
+
/** Current sort configuration */
|
|
146
|
+
sort?: DataTableSort;
|
|
147
|
+
/** Enable client-side sorting */
|
|
148
|
+
clientSort?: boolean;
|
|
149
|
+
/** Pagination configuration */
|
|
150
|
+
pagination?: DataTablePagination;
|
|
151
|
+
/** Enable client-side pagination */
|
|
152
|
+
clientPagination?: boolean;
|
|
153
|
+
/** Show pagination controls */
|
|
154
|
+
showPagination?: boolean;
|
|
155
|
+
/** Selection configuration */
|
|
156
|
+
selection?: DataTableSelection<T>;
|
|
157
|
+
/** Show selection column */
|
|
158
|
+
showSelectionColumn?: boolean;
|
|
159
|
+
/** Table size variant */
|
|
160
|
+
size?: 'small' | 'medium' | 'large';
|
|
161
|
+
/** Show borders */
|
|
162
|
+
bordered?: boolean;
|
|
163
|
+
/** Striped rows */
|
|
164
|
+
striped?: boolean;
|
|
165
|
+
/** Hoverable rows */
|
|
166
|
+
hoverable?: boolean;
|
|
167
|
+
/** Fixed header */
|
|
168
|
+
stickyHeader?: boolean;
|
|
169
|
+
/** Table max height (enables scrolling) */
|
|
170
|
+
maxHeight?: string;
|
|
171
|
+
/** Show row numbers */
|
|
172
|
+
showRowNumbers?: boolean;
|
|
173
|
+
/** Row number start */
|
|
174
|
+
rowNumberStart?: number;
|
|
175
|
+
/** Empty state configuration */
|
|
176
|
+
emptyState?: DataTableEmptyState;
|
|
177
|
+
/** Loading state */
|
|
178
|
+
loadingState?: DataTableLoadingState;
|
|
179
|
+
/** Custom CSS class */
|
|
180
|
+
cssClass?: string;
|
|
181
|
+
/** Header color */
|
|
182
|
+
headerColor?: Color;
|
|
183
|
+
/** Row click enabled */
|
|
184
|
+
rowClickable?: boolean;
|
|
185
|
+
/** Row actions template */
|
|
186
|
+
actionsTemplate?: TemplateRef<any>;
|
|
187
|
+
/** Actions column width */
|
|
188
|
+
actionsWidth?: string;
|
|
189
|
+
/** Actions column label */
|
|
190
|
+
actionsLabel?: string;
|
|
191
|
+
/** Table caption for screen readers */
|
|
192
|
+
caption?: string;
|
|
193
|
+
/** ARIA label */
|
|
194
|
+
ariaLabel?: string;
|
|
195
|
+
/** Content class for reactive content */
|
|
196
|
+
contentClass?: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Default pagination options.
|
|
200
|
+
*/
|
|
201
|
+
export declare const DEFAULT_PAGE_SIZE_OPTIONS: number[];
|
|
202
|
+
/**
|
|
203
|
+
* Default empty state.
|
|
204
|
+
*/
|
|
205
|
+
export declare const DEFAULT_EMPTY_STATE: DataTableEmptyState;
|
|
@@ -40,21 +40,27 @@ export type Action = {
|
|
|
40
40
|
*/
|
|
41
41
|
export declare enum InputType {
|
|
42
42
|
TEXT = 0,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
TEXTAREA = 1,
|
|
44
|
+
EMAIL = 2,
|
|
45
|
+
PASSWORD = 3,
|
|
46
|
+
COMMENT = 4,
|
|
47
|
+
NUMBER = 5,
|
|
48
|
+
NUMBER_FROM_TO = 6,
|
|
49
|
+
PIN_CODE = 7,
|
|
50
|
+
DATE = 8,
|
|
51
|
+
DATE_RANGE = 9,
|
|
52
|
+
HOUR = 10,
|
|
53
|
+
CHECK = 11,
|
|
54
|
+
RADIO = 12,
|
|
55
|
+
SELECT = 13,
|
|
56
|
+
SEARCH_SELECT = 14,
|
|
57
|
+
MULTI_SELECT = 15,
|
|
58
|
+
MULTI_SELECT_SIMPLE = 16,
|
|
59
|
+
FILE = 17,
|
|
60
|
+
TOGGLE = 18,
|
|
61
|
+
RANGE = 19,
|
|
62
|
+
PHONE = 20,
|
|
63
|
+
CURRENCY = 21
|
|
58
64
|
}
|
|
59
65
|
/**
|
|
60
66
|
* Option for select, radio, etc. inputs.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ConfirmationDialogMetadata, ConfirmationResult, ConfirmationButton } from './types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Service for displaying confirmation dialogs.
|
|
5
|
+
*
|
|
6
|
+
* @example Basic usage
|
|
7
|
+
* const result = await confirmationService.confirm({
|
|
8
|
+
* title: 'Delete Item',
|
|
9
|
+
* message: 'Are you sure you want to delete this item?',
|
|
10
|
+
* });
|
|
11
|
+
*
|
|
12
|
+
* if (result.confirmed) {
|
|
13
|
+
* // User confirmed
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* @example Custom buttons
|
|
17
|
+
* const result = await confirmationService.confirm({
|
|
18
|
+
* title: 'Save Changes',
|
|
19
|
+
* message: 'Do you want to save your changes before leaving?',
|
|
20
|
+
* confirmButton: { text: 'Save', color: 'success' },
|
|
21
|
+
* cancelButton: { text: 'Discard', color: 'danger' },
|
|
22
|
+
* extraButtons: [{ text: 'Cancel', role: 'cancel' }]
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* @example Destructive action
|
|
26
|
+
* const result = await confirmationService.confirmDestructive({
|
|
27
|
+
* title: 'Delete Account',
|
|
28
|
+
* message: 'This action cannot be undone. Are you sure?',
|
|
29
|
+
* });
|
|
30
|
+
*/
|
|
31
|
+
export declare class ConfirmationDialogService {
|
|
32
|
+
private alertController;
|
|
33
|
+
/**
|
|
34
|
+
* Shows a confirmation dialog and returns the result.
|
|
35
|
+
* @param options - Configuration for the dialog
|
|
36
|
+
* @returns Promise resolving to the confirmation result
|
|
37
|
+
*/
|
|
38
|
+
confirm(options: ConfirmationDialogMetadata): Promise<ConfirmationResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Shows a simple confirmation dialog with default buttons.
|
|
41
|
+
* @param title - Dialog title
|
|
42
|
+
* @param message - Dialog message
|
|
43
|
+
* @returns Promise resolving to true if confirmed, false otherwise
|
|
44
|
+
*/
|
|
45
|
+
confirmSimple(title: string, message: string): Promise<boolean>;
|
|
46
|
+
/**
|
|
47
|
+
* Shows a destructive action confirmation with red confirm button.
|
|
48
|
+
* @param options - Configuration for the dialog
|
|
49
|
+
* @returns Promise resolving to the confirmation result
|
|
50
|
+
*/
|
|
51
|
+
confirmDestructive(options: Omit<ConfirmationDialogMetadata, 'confirmButton'> & {
|
|
52
|
+
confirmButton?: Partial<ConfirmationButton>;
|
|
53
|
+
}): Promise<ConfirmationResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Shows an info alert with just an OK button.
|
|
56
|
+
* @param title - Alert title
|
|
57
|
+
* @param message - Alert message
|
|
58
|
+
*/
|
|
59
|
+
alert(title: string, message: string): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Shows a three-option dialog (Save, Discard, Cancel).
|
|
62
|
+
* Common for unsaved changes scenarios.
|
|
63
|
+
* @param title - Dialog title
|
|
64
|
+
* @param message - Dialog message
|
|
65
|
+
* @returns Promise resolving to 'save' | 'discard' | 'cancel'
|
|
66
|
+
*/
|
|
67
|
+
confirmSaveDiscard(title: string, message: string): Promise<'save' | 'discard' | 'cancel'>;
|
|
68
|
+
private buildButtons;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationDialogService, never>;
|
|
70
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ConfirmationDialogService>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Color } from '@ionic/core';
|
|
2
|
+
/**
|
|
3
|
+
* Button configuration for confirmation dialog.
|
|
4
|
+
*/
|
|
5
|
+
export interface ConfirmationButton {
|
|
6
|
+
/** Button text */
|
|
7
|
+
text: string;
|
|
8
|
+
/** Button role */
|
|
9
|
+
role?: 'cancel' | 'destructive' | 'confirm';
|
|
10
|
+
/** Button color (Ionic color) */
|
|
11
|
+
color?: Color;
|
|
12
|
+
/** CSS class for the button */
|
|
13
|
+
cssClass?: string;
|
|
14
|
+
/** Handler function called when button is clicked */
|
|
15
|
+
handler?: () => void | Promise<void> | boolean | Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Metadata for the confirmation dialog.
|
|
19
|
+
*/
|
|
20
|
+
export interface ConfirmationDialogMetadata {
|
|
21
|
+
/** Dialog title */
|
|
22
|
+
title: string;
|
|
23
|
+
/** Dialog message/content */
|
|
24
|
+
message: string;
|
|
25
|
+
/** Confirm button configuration */
|
|
26
|
+
confirmButton?: ConfirmationButton;
|
|
27
|
+
/** Cancel button configuration */
|
|
28
|
+
cancelButton?: ConfirmationButton;
|
|
29
|
+
/** Additional buttons (between cancel and confirm) */
|
|
30
|
+
extraButtons?: ConfirmationButton[];
|
|
31
|
+
/** Allow dismissing by clicking backdrop */
|
|
32
|
+
backdropDismiss?: boolean;
|
|
33
|
+
/** CSS class for the alert */
|
|
34
|
+
cssClass?: string;
|
|
35
|
+
/** Alert mode */
|
|
36
|
+
mode?: 'ios' | 'md';
|
|
37
|
+
/** Unique token identifier */
|
|
38
|
+
token?: string;
|
|
39
|
+
/** Translucent backdrop */
|
|
40
|
+
translucent?: boolean;
|
|
41
|
+
/** Animated transitions */
|
|
42
|
+
animated?: boolean;
|
|
43
|
+
/** Header subtitle */
|
|
44
|
+
subHeader?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Result from confirmation dialog.
|
|
48
|
+
*/
|
|
49
|
+
export interface ConfirmationResult {
|
|
50
|
+
/** Whether the dialog was confirmed */
|
|
51
|
+
confirmed: boolean;
|
|
52
|
+
/** The role of the button clicked */
|
|
53
|
+
role?: string;
|
|
54
|
+
/** Any data returned */
|
|
55
|
+
data?: any;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Default confirmation dialog options.
|
|
59
|
+
*/
|
|
60
|
+
export declare const DEFAULT_CONFIRM_BUTTON: ConfirmationButton;
|
|
61
|
+
export declare const DEFAULT_CANCEL_BUTTON: ConfirmationButton;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ModalMetadata, SimpleModalMetadata, ModalResult, ModalButton } from './types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* ModalService
|
|
5
|
+
*
|
|
6
|
+
* A service for creating and managing modals with various configurations.
|
|
7
|
+
*
|
|
8
|
+
* @example Basic component modal
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const result = await modalService.open({
|
|
11
|
+
* component: MyFormComponent,
|
|
12
|
+
* componentProps: { userId: 123 },
|
|
13
|
+
* header: { title: 'Edit User', showCloseButton: true },
|
|
14
|
+
* size: 'medium'
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* if (result.role === 'confirm') {
|
|
18
|
+
* console.log('Saved:', result.data);
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example Simple content modal
|
|
23
|
+
* ```typescript
|
|
24
|
+
* await modalService.openSimple({
|
|
25
|
+
* title: 'Terms of Service',
|
|
26
|
+
* content: '<p>Terms content here...</p>',
|
|
27
|
+
* size: 'large',
|
|
28
|
+
* showCloseButton: true
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example Sheet modal (mobile)
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const result = await modalService.openSheet({
|
|
35
|
+
* component: FilterComponent,
|
|
36
|
+
* breakpoints: {
|
|
37
|
+
* initialBreakpoint: 0.5,
|
|
38
|
+
* breakpoints: [0, 0.5, 1],
|
|
39
|
+
* showHandle: true
|
|
40
|
+
* }
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare class ModalService {
|
|
45
|
+
private modalController;
|
|
46
|
+
/**
|
|
47
|
+
* Opens a modal with a component.
|
|
48
|
+
* @param options - Modal configuration
|
|
49
|
+
* @returns Promise resolving to the modal result
|
|
50
|
+
*/
|
|
51
|
+
open<T = any, R = any>(options: ModalMetadata<T>): Promise<ModalResult<R>>;
|
|
52
|
+
/**
|
|
53
|
+
* Opens a simple content modal without a custom component.
|
|
54
|
+
* Uses Ionic's alert-like styling but with modal capabilities.
|
|
55
|
+
* @param options - Simple modal configuration
|
|
56
|
+
* @returns Promise resolving to the modal result
|
|
57
|
+
*/
|
|
58
|
+
openSimple(options: SimpleModalMetadata): Promise<ModalResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Opens a confirmation modal.
|
|
61
|
+
* @param title - Modal title
|
|
62
|
+
* @param message - Modal message
|
|
63
|
+
* @param confirmButton - Confirm button config (optional)
|
|
64
|
+
* @param cancelButton - Cancel button config (optional)
|
|
65
|
+
* @returns Promise resolving to true if confirmed
|
|
66
|
+
*/
|
|
67
|
+
confirm(title: string, message: string, confirmButton?: Partial<ModalButton>, cancelButton?: Partial<ModalButton>): Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* Opens a sheet modal (iOS-style bottom sheet).
|
|
70
|
+
* @param options - Modal configuration with sheet-specific options
|
|
71
|
+
* @returns Promise resolving to the modal result
|
|
72
|
+
*/
|
|
73
|
+
openSheet<T = any, R = any>(options: Omit<ModalMetadata<T>, 'breakpoints'> & {
|
|
74
|
+
initialBreakpoint?: number;
|
|
75
|
+
breakpoints?: number[];
|
|
76
|
+
showHandle?: boolean;
|
|
77
|
+
}): Promise<ModalResult<R>>;
|
|
78
|
+
/**
|
|
79
|
+
* Opens a fullscreen modal.
|
|
80
|
+
* @param options - Modal configuration
|
|
81
|
+
* @returns Promise resolving to the modal result
|
|
82
|
+
*/
|
|
83
|
+
openFullscreen<T = any, R = any>(options: ModalMetadata<T>): Promise<ModalResult<R>>;
|
|
84
|
+
/**
|
|
85
|
+
* Dismisses the top-most modal.
|
|
86
|
+
* @param data - Optional data to return
|
|
87
|
+
* @param role - Optional role
|
|
88
|
+
*/
|
|
89
|
+
dismiss(data?: any, role?: string): Promise<boolean>;
|
|
90
|
+
/**
|
|
91
|
+
* Gets the top-most modal.
|
|
92
|
+
*/
|
|
93
|
+
getTop(): Promise<HTMLIonModalElement | undefined>;
|
|
94
|
+
private normalizeCanDismiss;
|
|
95
|
+
private buildCssClasses;
|
|
96
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ModalService, never>;
|
|
97
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ModalService>;
|
|
98
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ModalButton } from './types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Internal component for simple content modals.
|
|
5
|
+
* Used by ModalService.openSimple()
|
|
6
|
+
*/
|
|
7
|
+
export declare class SimpleModalContentComponent {
|
|
8
|
+
title: string;
|
|
9
|
+
content: string;
|
|
10
|
+
buttons: ModalButton[];
|
|
11
|
+
showCloseButton: boolean;
|
|
12
|
+
_modalRef: {
|
|
13
|
+
dismiss: (data?: any, role?: string) => Promise<boolean>;
|
|
14
|
+
};
|
|
15
|
+
onButtonClick(button: ModalButton): Promise<void>;
|
|
16
|
+
onDismiss(role: string): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SimpleModalContentComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SimpleModalContentComponent, "val-simple-modal-content", never, { "title": { "alias": "title"; "required": false; }; "content": { "alias": "content"; "required": false; }; "buttons": { "alias": "buttons"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; "_modalRef": { "alias": "_modalRef"; "required": false; }; }, {}, never, never, true, never>;
|
|
19
|
+
}
|