wcs-core 2.5.3 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -5
- package/README.md +17 -1
- package/dist/cjs/component-fc28ed16.js +1074 -0
- package/dist/cjs/helpers-6abce594.js +86 -0
- package/dist/cjs/{index-e05c3e1f.js → index-3cb9d725.js} +165 -87
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/{esm/wcs-action-bar_47.entry.js → cjs/lodash-776d6f03.js} +12499 -22628
- package/dist/cjs/popper-5777994b.js +1732 -0
- package/dist/cjs/select-arrow-76ccf86d.js +36 -0
- package/dist/cjs/wcs-action-bar.cjs.entry.js +24 -0
- package/dist/cjs/wcs-app.cjs.entry.js +2 -2
- package/dist/cjs/wcs-badge.cjs.entry.js +27 -0
- package/dist/cjs/wcs-button.cjs.entry.js +86 -0
- package/dist/cjs/wcs-card-body.cjs.entry.js +19 -0
- package/dist/cjs/wcs-card.cjs.entry.js +20 -0
- package/dist/cjs/wcs-checkbox.cjs.entry.js +47 -0
- package/dist/cjs/wcs-com-nav-category.cjs.entry.js +63 -0
- package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +69 -0
- package/dist/cjs/wcs-com-nav.cjs.entry.js +19 -0
- package/dist/cjs/wcs-divider.cjs.entry.js +19 -0
- package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +19 -0
- package/dist/cjs/wcs-dropdown-header.cjs.entry.js +19 -0
- package/dist/cjs/wcs-dropdown-item.cjs.entry.js +23 -0
- package/dist/cjs/wcs-dropdown.cjs.entry.js +90 -0
- package/dist/cjs/wcs-editable-field.cjs.entry.js +225 -0
- package/dist/cjs/wcs-error_2.cjs.entry.js +137 -0
- package/dist/cjs/wcs-field-content.cjs.entry.js +16 -0
- package/dist/cjs/wcs-field-label.cjs.entry.js +16 -0
- package/dist/cjs/wcs-field.cjs.entry.js +19 -0
- package/dist/cjs/wcs-footer.cjs.entry.js +19 -0
- package/dist/cjs/wcs-galactic-menu.cjs.entry.js +58 -0
- package/dist/cjs/wcs-galactic.cjs.entry.js +41 -0
- package/dist/cjs/wcs-grid-column.cjs.entry.js +77 -0
- package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +16 -0
- package/dist/cjs/wcs-grid-pagination.cjs.entry.js +4 -4
- package/dist/cjs/wcs-grid.cjs.entry.js +332 -0
- package/dist/cjs/wcs-header.cjs.entry.js +25 -0
- package/dist/cjs/wcs-hint.cjs.entry.js +20 -0
- package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +114 -0
- package/dist/cjs/wcs-icon.cjs.entry.js +2 -2
- package/dist/cjs/wcs-input.cjs.entry.js +228 -0
- package/dist/cjs/wcs-label.cjs.entry.js +20 -0
- package/dist/cjs/wcs-list-item-properties.cjs.entry.js +19 -0
- package/dist/cjs/wcs-list-item-property.cjs.entry.js +19 -0
- package/dist/cjs/wcs-list-item.cjs.entry.js +23 -0
- package/dist/cjs/wcs-mat-icon.cjs.entry.js +73 -0
- package/dist/cjs/wcs-modal.cjs.entry.js +45 -0
- package/dist/cjs/wcs-nav-item.cjs.entry.js +23 -0
- package/dist/cjs/wcs-nav.cjs.entry.js +19 -0
- package/dist/cjs/wcs-progress-bar.cjs.entry.js +47 -0
- package/dist/cjs/wcs-progress-radial.cjs.entry.js +30 -0
- package/dist/cjs/wcs-radio-group.cjs.entry.js +65 -0
- package/dist/cjs/wcs-radio.cjs.entry.js +49 -0
- package/dist/cjs/wcs-select_2.cjs.entry.js +4916 -0
- package/dist/cjs/wcs-spinner.cjs.entry.js +21 -0
- package/dist/cjs/wcs-switch.cjs.entry.js +42 -0
- package/dist/cjs/wcs-tab.cjs.entry.js +20 -0
- package/dist/cjs/wcs-tabs.cjs.entry.js +159 -0
- package/dist/cjs/wcs-textarea.cjs.entry.js +224 -0
- package/dist/cjs/wcs-tooltip.cjs.entry.js +1635 -0
- package/dist/cjs/wcs.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/badge/badge-interface.js +1 -0
- package/dist/collection/components/badge/badge.js +14 -4
- package/dist/collection/components/button/button.css +79 -75
- package/dist/collection/components/button/button.js +23 -11
- package/dist/collection/components/card/card-interface.js +1 -0
- package/dist/collection/components/card/card.js +7 -2
- package/dist/collection/components/checkbox/checkbox.css +18 -7
- package/dist/collection/components/checkbox/checkbox.js +24 -2
- package/dist/collection/components/com-nav/com-nav.css +1 -2
- package/dist/collection/components/com-nav-category/com-nav-category.css +5 -6
- package/dist/collection/components/com-nav-category/com-nav-category.js +31 -1
- package/dist/collection/components/com-nav-submenu/com-nav-submenu.css +1 -2
- package/dist/collection/components/com-nav-submenu/com-nav-submenu.js +21 -1
- package/dist/collection/components/dropdown/dropdown-interface.js +1 -0
- package/dist/collection/components/dropdown/dropdown.css +46 -38
- package/dist/collection/components/dropdown/dropdown.js +90 -29
- package/dist/collection/components/dropdown-divider/dropdown-divider.css +7 -0
- package/dist/collection/components/dropdown-divider/dropdown-divider.js +14 -0
- package/dist/collection/components/dropdown-header/dropdown-header.css +8 -0
- package/dist/collection/components/dropdown-header/dropdown-header.js +15 -0
- package/dist/collection/components/editable-field/editable-field.js +7 -2
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/form-field/form-field.css +1 -2
- package/dist/collection/components/form-field/form-field.js +0 -17
- package/dist/collection/components/grid/grid.js +75 -13
- package/dist/collection/components/grid-column/grid-column.css +5 -0
- package/dist/collection/components/grid-column/grid-column.js +69 -3
- package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +45 -0
- package/dist/collection/components/grid-pagination/grid-pagination.js +4 -4
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +7 -2
- package/dist/collection/components/input/input.css +48 -0
- package/dist/collection/components/input/input.js +40 -4
- package/dist/collection/components/mat-icon/mat-icon.css +1 -1
- package/dist/collection/components/mat-icon/mat-icon.js +7 -2
- package/dist/collection/components/modal/modal.css +8 -5
- package/dist/collection/components/modal/modal.js +5 -5
- package/dist/collection/components/nav-item/nav-item.js +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +4 -4
- package/dist/collection/components/radio/radio.component.js +9 -4
- package/dist/collection/components/radio/radio.css +43 -18
- package/dist/collection/components/radio-group/radio-group.css +4 -0
- package/dist/collection/components/radio-group/radio-group.js +10 -5
- package/dist/collection/components/select/select.css +81 -77
- package/dist/collection/components/select/select.js +2 -2
- package/dist/collection/components/select-option/select-option.css +79 -75
- package/dist/collection/components/select-option/select-option.js +6 -7
- package/dist/collection/components/spinner/spinner-interface.js +1 -0
- package/dist/collection/components/spinner/spinner.js +8 -3
- package/dist/collection/components/switch/switch.css +53 -16
- package/dist/collection/components/switch/switch.js +55 -6
- package/dist/collection/components/tab/tab.js +5 -5
- package/dist/collection/components/tabs/tabs.js +2 -2
- package/dist/collection/components/textarea/textarea.css +4 -0
- package/dist/collection/components/textarea/textarea.js +2 -2
- package/dist/collection/components/tooltip/tooltip.css +3 -0
- package/dist/collection/components/tooltip/tooltip.js +310 -92
- package/dist/collection/utils/helpers.js +4 -0
- package/dist/esm/component-6b4d470f.js +1072 -0
- package/dist/esm/helpers-e2993152.js +77 -0
- package/dist/esm/{index-c619b1fa.js → index-b982604a.js} +165 -88
- package/dist/esm/loader.js +3 -3
- package/dist/{cjs/wcs-action-bar_47.cjs.entry.js → esm/lodash-d6d9d079.js} +12610 -22791
- package/dist/esm/popper-5f42e560.js +1729 -0
- package/dist/esm/select-arrow-73ac4016.js +34 -0
- package/dist/esm/wcs-action-bar.entry.js +20 -0
- package/dist/esm/wcs-app.entry.js +2 -2
- package/dist/esm/wcs-badge.entry.js +23 -0
- package/dist/esm/wcs-button.entry.js +82 -0
- package/dist/esm/wcs-card-body.entry.js +15 -0
- package/dist/esm/wcs-card.entry.js +16 -0
- package/dist/esm/wcs-checkbox.entry.js +43 -0
- package/dist/esm/wcs-com-nav-category.entry.js +59 -0
- package/dist/esm/wcs-com-nav-submenu.entry.js +65 -0
- package/dist/esm/wcs-com-nav.entry.js +15 -0
- package/dist/esm/wcs-divider.entry.js +15 -0
- package/dist/esm/wcs-dropdown-divider.entry.js +15 -0
- package/dist/esm/wcs-dropdown-header.entry.js +15 -0
- package/dist/esm/wcs-dropdown-item.entry.js +19 -0
- package/dist/esm/wcs-dropdown.entry.js +86 -0
- package/dist/esm/wcs-editable-field.entry.js +221 -0
- package/dist/esm/wcs-error_2.entry.js +132 -0
- package/dist/esm/wcs-field-content.entry.js +12 -0
- package/dist/esm/wcs-field-label.entry.js +12 -0
- package/dist/esm/wcs-field.entry.js +15 -0
- package/dist/esm/wcs-footer.entry.js +15 -0
- package/dist/esm/wcs-galactic-menu.entry.js +54 -0
- package/dist/esm/wcs-galactic.entry.js +37 -0
- package/dist/esm/wcs-grid-column.entry.js +73 -0
- package/dist/esm/wcs-grid-custom-cell.entry.js +12 -0
- package/dist/esm/wcs-grid-pagination.entry.js +4 -4
- package/dist/esm/wcs-grid.entry.js +328 -0
- package/dist/esm/wcs-header.entry.js +21 -0
- package/dist/esm/wcs-hint.entry.js +16 -0
- package/dist/esm/wcs-horizontal-stepper.entry.js +110 -0
- package/dist/esm/wcs-icon.entry.js +2 -2
- package/dist/esm/wcs-input.entry.js +224 -0
- package/dist/esm/wcs-label.entry.js +16 -0
- package/dist/esm/wcs-list-item-properties.entry.js +15 -0
- package/dist/esm/wcs-list-item-property.entry.js +15 -0
- package/dist/esm/wcs-list-item.entry.js +19 -0
- package/dist/esm/wcs-mat-icon.entry.js +69 -0
- package/dist/esm/wcs-modal.entry.js +41 -0
- package/dist/esm/wcs-nav-item.entry.js +19 -0
- package/dist/esm/wcs-nav.entry.js +15 -0
- package/dist/esm/wcs-progress-bar.entry.js +43 -0
- package/dist/esm/wcs-progress-radial.entry.js +26 -0
- package/dist/esm/wcs-radio-group.entry.js +61 -0
- package/dist/esm/wcs-radio.entry.js +45 -0
- package/dist/esm/wcs-select_2.entry.js +4911 -0
- package/dist/esm/wcs-spinner.entry.js +17 -0
- package/dist/esm/wcs-switch.entry.js +38 -0
- package/dist/esm/wcs-tab.entry.js +16 -0
- package/dist/esm/wcs-tabs.entry.js +155 -0
- package/dist/esm/wcs-textarea.entry.js +220 -0
- package/dist/esm/wcs-tooltip.entry.js +1631 -0
- package/dist/esm/wcs.js +3 -3
- package/dist/types/components/badge/badge-interface.d.ts +2 -0
- package/dist/types/components/badge/badge.d.ts +3 -2
- package/dist/types/components/button/button.d.ts +7 -3
- package/dist/types/components/card/card-interface.d.ts +1 -0
- package/dist/types/components/card/card.d.ts +2 -1
- package/dist/types/components/checkbox/checkbox.d.ts +4 -0
- package/dist/types/components/com-nav-category/com-nav-category.d.ts +7 -0
- package/dist/types/components/com-nav-submenu/com-nav-submenu.d.ts +7 -0
- package/dist/types/components/dropdown/dropdown-interface.d.ts +1 -0
- package/dist/types/components/dropdown/dropdown.d.ts +13 -16
- package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
- package/dist/types/components/dropdown-header/dropdown-header.d.ts +3 -0
- package/dist/types/components/editable-field/editable-field-interface.d.ts +1 -0
- package/dist/types/components/editable-field/editable-field.d.ts +2 -2
- package/dist/types/components/form-field/form-field.d.ts +0 -4
- package/dist/types/components/grid/grid.d.ts +18 -0
- package/dist/types/components/grid-column/grid-column.d.ts +5 -0
- package/dist/types/components/grid-custom-cell/grid-custom-cell.d.ts +12 -0
- package/dist/types/components/horizontal-stepper/horizontal-stepper-interface.d.ts +1 -0
- package/dist/types/components/horizontal-stepper/horizontal-stepper.d.ts +2 -2
- package/dist/types/components/input/input.d.ts +8 -0
- package/dist/types/components/mat-icon/mat-icon-interface.d.ts +1 -0
- package/dist/types/components/mat-icon/mat-icon.d.ts +2 -2
- package/dist/types/components/modal/modal.d.ts +1 -1
- package/dist/types/components/radio/radio.component.d.ts +2 -1
- package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
- package/dist/types/components/radio-group/radio-group.d.ts +2 -2
- package/dist/types/components/select-option/select-option.d.ts +2 -0
- package/dist/types/components/spinner/spinner-interface.d.ts +1 -0
- package/dist/types/components/spinner/spinner.d.ts +2 -1
- package/dist/types/components/switch/switch-interface.d.ts +1 -0
- package/dist/types/components/switch/switch.d.ts +10 -2
- package/dist/types/components/tooltip/tooltip.d.ts +70 -6
- package/dist/types/components.d.ts +244 -41
- package/dist/types/interfaces.d.ts +21 -0
- package/dist/types/stencil-public-runtime.d.ts +183 -182
- package/dist/types/utils/helpers.d.ts +1 -0
- package/dist/wcs/p-03b2e238.entry.js +1 -0
- package/dist/wcs/p-08a7e84d.entry.js +1 -0
- package/dist/wcs/p-0a103e06.entry.js +1 -0
- package/dist/wcs/p-16dfbae8.js +127 -0
- package/dist/wcs/p-1dce7e63.entry.js +1 -0
- package/dist/wcs/p-1e16709a.entry.js +1 -0
- package/dist/wcs/p-1f5aed36.entry.js +1 -0
- package/dist/wcs/p-214236db.entry.js +1 -0
- package/dist/wcs/p-22813c8e.entry.js +1 -0
- package/dist/wcs/p-26b5c0a3.entry.js +1 -0
- package/dist/wcs/p-2e6265dc.entry.js +1 -0
- package/dist/wcs/p-384068f7.entry.js +1 -0
- package/dist/wcs/p-41037455.entry.js +1 -0
- package/dist/wcs/p-474d6601.entry.js +1 -0
- package/dist/wcs/p-4e9e226d.entry.js +1 -0
- package/dist/wcs/p-55fdc284.entry.js +1 -0
- package/dist/wcs/p-57247184.entry.js +1 -0
- package/dist/wcs/p-5b35b232.entry.js +1 -0
- package/dist/wcs/p-600a9cc0.entry.js +1 -0
- package/dist/wcs/p-60b51967.entry.js +1 -0
- package/dist/wcs/p-65c5ccc5.entry.js +1 -0
- package/dist/wcs/p-688fea65.entry.js +1 -0
- package/dist/wcs/p-6b8d2bc7.entry.js +1 -0
- package/dist/wcs/p-716d5921.entry.js +1 -0
- package/dist/wcs/p-7206e492.entry.js +1 -0
- package/dist/wcs/p-7219c04b.js +1 -0
- package/dist/wcs/p-8137f075.entry.js +1 -0
- package/dist/wcs/p-8864a491.entry.js +1 -0
- package/dist/wcs/p-8c8740e3.entry.js +1 -0
- package/dist/wcs/p-91a2de07.entry.js +1 -0
- package/dist/wcs/p-94a31f64.entry.js +1 -0
- package/dist/wcs/p-979dfd78.entry.js +1 -0
- package/dist/wcs/p-9ba52bc4.entry.js +1 -0
- package/dist/wcs/p-a1ee1551.entry.js +1 -0
- package/dist/wcs/p-a92d369e.entry.js +1 -0
- package/dist/wcs/p-a978c1e3.entry.js +1 -0
- package/dist/wcs/p-adef7aaf.js +1 -0
- package/dist/wcs/p-b5ffbea8.entry.js +1 -0
- package/dist/wcs/p-b7184d59.entry.js +1 -0
- package/dist/wcs/p-bbf1ef42.entry.js +1 -0
- package/dist/wcs/p-c7d6d3e1.entry.js +15 -0
- package/dist/wcs/p-cf4d7a83.js +1 -0
- package/dist/wcs/p-d3c9a644.js +1 -0
- package/dist/wcs/p-db68379f.entry.js +1 -0
- package/dist/wcs/p-dbbc3f58.entry.js +1 -0
- package/dist/wcs/p-dc817204.entry.js +1 -0
- package/dist/wcs/p-e0163de8.entry.js +1 -0
- package/dist/wcs/p-e4236d32.entry.js +1 -0
- package/dist/wcs/p-e43358e4.entry.js +1 -0
- package/dist/wcs/p-e9ce507c.entry.js +1 -0
- package/dist/wcs/p-ecbe5165.entry.js +6 -0
- package/dist/wcs/p-f46e6c3c.js +1 -0
- package/dist/wcs/p-f9944bde.entry.js +1 -0
- package/dist/wcs/p-fa173947.entry.js +1 -0
- package/dist/wcs/p-fb1577b5.entry.js +1 -0
- package/dist/wcs/p-febe9ccc.entry.js +1 -0
- package/dist/wcs/p-ff6d0dfd.entry.js +1 -0
- package/dist/wcs/wcs.css +1 -1
- package/dist/wcs/wcs.esm.js +1 -1
- package/loader/index.d.ts +0 -1
- package/package.json +25 -22
- package/dist/types/interface.d.ts +0 -3
- package/dist/wcs/p-16dca526.entry.js +0 -1
- package/dist/wcs/p-4f228fcb.entry.js +0 -134
- package/dist/wcs/p-66520e5a.entry.js +0 -1
- package/dist/wcs/p-d31287c6.entry.js +0 -1
- package/dist/wcs/p-f73f235b.js +0 -1
- package/schematics/.gitignore +0 -18
- package/schematics/.npmignore +0 -4
- package/schematics/collection.json +0 -9
- package/schematics/src/ng-add/files/fonts/avenir-black.woff +0 -0
- package/schematics/src/ng-add/files/fonts/avenir-book.woff +0 -0
- package/schematics/src/ng-add/files/fonts/avenir-lighter.woff +0 -0
- package/schematics/src/ng-add/files/fonts/avenir-medium.woff +0 -0
- package/schematics/src/ng-add/files/sncf-logo.png +0 -0
- package/schematics/src/ng-add/index.d.ts +0 -3
- package/schematics/src/ng-add/index.js +0 -119
- package/schematics/src/ng-add/index.js.map +0 -1
- package/schematics/src/ng-add/schema.json +0 -5
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
const editableFieldCss = ":host{display:block}:host .display-none{display:none !important}:host .label{margin-bottom:var(--wcs-base-margin);font-weight:500;font-size:16px;color:var(--wcs-gray-light)}:host .edit-container{display:flex;width:100%}:host .display-container{min-height:24px;white-space:break-spaces;display:flex;justify-content:space-between;align-items:center;background-color:var(--wcs-light);border-radius:var(--wcs-border-radius);font-size:1rem;line-height:1.5;font-weight:500;color:var(--wcs-gray);padding:calc(0.5 * var(--wcs-padding)) var(--wcs-padding);transition:0.175s all;border:solid 1px transparent}:host .display-container wcs-mat-icon{display:none}:host .load-container{white-space:pre;display:flex;justify-content:space-between;background-color:var(--wcs-light);border-radius:var(--wcs-border-radius);font-size:1rem;line-height:1.5;font-weight:500;color:var(--wcs-gray);padding:calc(0.5 * var(--wcs-padding)) var(--wcs-padding);transition:0.175s all;border:solid 1px transparent;align-items:center}:host wcs-spinner{height:16px;width:16px}:host .readonly-icon{fill:var(--wcs-text-medium)}:host([readonly]) .display-container{color:var(--wcs-gray-light)}:host(:not([readonly])) .display-container:hover{color:var(--wcs-primary);cursor:pointer;border:solid 1px var(--wcs-primary)}:host(:not([readonly])) .display-container:hover wcs-mat-icon{display:flex;align-items:center}";
|
|
8
|
+
|
|
9
|
+
var EditableComponentState;
|
|
10
|
+
(function (EditableComponentState) {
|
|
11
|
+
EditableComponentState[EditableComponentState["DISPLAY"] = 0] = "DISPLAY";
|
|
12
|
+
EditableComponentState[EditableComponentState["EDIT"] = 1] = "EDIT";
|
|
13
|
+
EditableComponentState[EditableComponentState["LOAD"] = 2] = "LOAD";
|
|
14
|
+
})(EditableComponentState || (EditableComponentState = {}));
|
|
15
|
+
let EditableField = class {
|
|
16
|
+
constructor(hostRef) {
|
|
17
|
+
index.registerInstance(this, hostRef);
|
|
18
|
+
this.wcsChange = index.createEvent(this, "wcsChange", 7);
|
|
19
|
+
this.currentState = EditableComponentState.DISPLAY;
|
|
20
|
+
/**
|
|
21
|
+
* Specifies which component is used for editing
|
|
22
|
+
*/
|
|
23
|
+
this.type = 'input';
|
|
24
|
+
/**
|
|
25
|
+
* Specify whether the field is editable or not
|
|
26
|
+
*/
|
|
27
|
+
this.readonly = false;
|
|
28
|
+
/**
|
|
29
|
+
* Error message displayed under the field if validation failed.
|
|
30
|
+
*/
|
|
31
|
+
this.errorMsg = null;
|
|
32
|
+
this.isError = false;
|
|
33
|
+
this.ignoreNextChangeEvent = false;
|
|
34
|
+
this.spiedElement = null;
|
|
35
|
+
this.currentValue = null;
|
|
36
|
+
}
|
|
37
|
+
componentWillLoad() {
|
|
38
|
+
this.currentValue = this.value;
|
|
39
|
+
}
|
|
40
|
+
componentDidRender() {
|
|
41
|
+
const assignedElements = this.el.shadowRoot.querySelector('slot').assignedElements();
|
|
42
|
+
switch (this.type) {
|
|
43
|
+
case 'input':
|
|
44
|
+
this.initWithInput(assignedElements);
|
|
45
|
+
break;
|
|
46
|
+
case 'textarea':
|
|
47
|
+
this.initWithTextArea(assignedElements);
|
|
48
|
+
break;
|
|
49
|
+
case 'select':
|
|
50
|
+
this.initWithSelect(assignedElements);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
initWithInput(assignedElements) {
|
|
55
|
+
const element = assignedElements.filter(x => {
|
|
56
|
+
return x.tagName === 'WCS-INPUT';
|
|
57
|
+
})[0];
|
|
58
|
+
if (!element)
|
|
59
|
+
throw new Error('You must provide a slotted input element to handle edition');
|
|
60
|
+
this.spiedElement = element;
|
|
61
|
+
this.addChangeHandlerForWcsComponents(this.spiedElement);
|
|
62
|
+
this.spiedElement.addEventListener('keydown', (event) => {
|
|
63
|
+
if (event.key === 'Enter') {
|
|
64
|
+
this.sendCurrentValue();
|
|
65
|
+
}
|
|
66
|
+
if (event.key === 'Escape') {
|
|
67
|
+
this.discardChanges();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
initWithTextArea(assignedElements) {
|
|
72
|
+
const element = assignedElements.filter(x => {
|
|
73
|
+
return x.tagName === 'WCS-TEXTAREA';
|
|
74
|
+
})[0];
|
|
75
|
+
if (!element)
|
|
76
|
+
throw new Error('You must provide a slotted textarea element to handle edition');
|
|
77
|
+
this.spiedElement = element;
|
|
78
|
+
this.addChangeHandlerForWcsComponents(this.spiedElement);
|
|
79
|
+
this.spiedElement.addEventListener('keydown', (event) => {
|
|
80
|
+
if (event.key === 'Enter' && event.ctrlKey) {
|
|
81
|
+
this.sendCurrentValue();
|
|
82
|
+
}
|
|
83
|
+
if (event.key === 'Escape') {
|
|
84
|
+
this.discardChanges();
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
initWithSelect(assignedElements) {
|
|
89
|
+
const element = assignedElements.filter(x => {
|
|
90
|
+
return x.tagName === 'WCS-SELECT';
|
|
91
|
+
})[0];
|
|
92
|
+
if (!element)
|
|
93
|
+
throw new Error('You must provide a slotted select element to handle edition');
|
|
94
|
+
this.spiedElement = element;
|
|
95
|
+
this.addChangeHandlerForWcsComponents(this.spiedElement);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* This method subscribes the component to the change events produced by the other WCS components
|
|
99
|
+
* (provided by the user in slot)
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
addChangeHandlerForWcsComponents(elt) {
|
|
103
|
+
elt.addEventListener('wcsChange', (event) => {
|
|
104
|
+
event.stopImmediatePropagation();
|
|
105
|
+
this.currentValue = event.detail.value;
|
|
106
|
+
if (this.validateFn) {
|
|
107
|
+
this.isError = !this.validateFn(this.currentValue);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
sendCurrentValue() {
|
|
112
|
+
if (this.currentState === EditableComponentState.EDIT) {
|
|
113
|
+
if (this.value === this.currentValue) {
|
|
114
|
+
this.currentState = EditableComponentState.DISPLAY;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
this.isError = this.validateFn ? !this.validateFn(this.currentValue) : false;
|
|
118
|
+
if (!this.isError) {
|
|
119
|
+
this.currentState = EditableComponentState.LOAD;
|
|
120
|
+
this.wcsChange.emit({
|
|
121
|
+
newValue: this.currentValue,
|
|
122
|
+
successHandler: () => this.forceDisplayStateAndValidate(),
|
|
123
|
+
errorhandler: () => this.errorHandler()
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
discardChanges() {
|
|
130
|
+
this.currentValue = this.value;
|
|
131
|
+
this.currentState = EditableComponentState.DISPLAY;
|
|
132
|
+
this.isError = false;
|
|
133
|
+
}
|
|
134
|
+
forceDisplayStateAndValidate() {
|
|
135
|
+
if (this.currentState === EditableComponentState.LOAD) {
|
|
136
|
+
this.value = this.currentValue;
|
|
137
|
+
this.currentState = EditableComponentState.DISPLAY;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
throw new Error('You cannot set display state from ' + EditableComponentState[this.currentState] + ' state');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
onWindowClickEvent(event) {
|
|
144
|
+
if (!this.clickInsideComponent(event)) {
|
|
145
|
+
if (this.currentState === EditableComponentState.EDIT) {
|
|
146
|
+
if (this.isError) {
|
|
147
|
+
this.discardChanges();
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
this.sendCurrentValue();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
clickInsideComponent(event) {
|
|
156
|
+
return event.x >= this.el.getBoundingClientRect().x && event.x <= this.el.getBoundingClientRect().x + this.el.getBoundingClientRect().width
|
|
157
|
+
&& event.y >= this.el.getBoundingClientRect().y && event.y <= this.el.getBoundingClientRect().y + this.el.getBoundingClientRect().height;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* discard changes and force component state to DISPLAY
|
|
161
|
+
* <br/>
|
|
162
|
+
* This method must be call when component is in LOAD state
|
|
163
|
+
*/
|
|
164
|
+
errorHandler() {
|
|
165
|
+
this.discardChanges();
|
|
166
|
+
}
|
|
167
|
+
onValueChange() {
|
|
168
|
+
this.currentState = EditableComponentState.DISPLAY;
|
|
169
|
+
}
|
|
170
|
+
onDisplayContainerClick() {
|
|
171
|
+
if (this.currentState === EditableComponentState.DISPLAY && this.readonly === false) {
|
|
172
|
+
this.currentState = EditableComponentState.EDIT;
|
|
173
|
+
this.ignoreNextChangeEvent = true;
|
|
174
|
+
this.spiedElement['value'] = this.currentValue;
|
|
175
|
+
if (this.validateFn) {
|
|
176
|
+
this.isError = !this.validateFn(this.currentValue);
|
|
177
|
+
}
|
|
178
|
+
// We wait until the element is displayed on the page otherwise the focus does not work
|
|
179
|
+
const DELAY_FOR_RENDER = 20;
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
if (this.type === 'input') {
|
|
182
|
+
this.spiedElement.setFocus();
|
|
183
|
+
}
|
|
184
|
+
else if (this.type === 'textarea') {
|
|
185
|
+
this.spiedElement.fitContent();
|
|
186
|
+
this.spiedElement.setFocus();
|
|
187
|
+
}
|
|
188
|
+
}, DELAY_FOR_RENDER);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
render() {
|
|
192
|
+
const { formattedValue, formattedCurrentValue } = this.formatValues();
|
|
193
|
+
return (index.h(index.Host, null, index.h("div", { class: "label" }, this.label), index.h("div", { class: 'display-container ' + (this.currentState !== EditableComponentState.DISPLAY ? 'display-none' : ''), onClick: () => this.onDisplayContainerClick() }, formattedValue, index.h("wcs-mat-icon", { icon: "edit", size: "s" }), this.readonly ? this.getReadonlySvgIcon() : null), index.h("div", { class: 'load-container ' + (this.currentState !== EditableComponentState.LOAD ? 'display-none' : '') }, formattedCurrentValue, index.h("wcs-spinner", null)), index.h("wcs-form-field", { "is-error": this.isError, class: 'edit-container ' + (this.currentState !== EditableComponentState.EDIT ? 'display-none' : '') }, index.h("slot", null), this.isError && this.errorMsg
|
|
194
|
+
? index.h("wcs-error", null, this.errorMsg)
|
|
195
|
+
: null)));
|
|
196
|
+
}
|
|
197
|
+
getReadonlySvgIcon() {
|
|
198
|
+
return index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "26", height: "24", viewBox: "0 0 27 25", class: "readonly-icon" }, index.h("path", { d: "M26.79,25.05H1.21a.73.73,0,0,0,0,1.45H26.79a.73.73,0,0,0,0-1.45Z", transform: "translate(-0.5 -1.5)" }), index.h("path", { d: "M19.8,8.87h-.61V6.73a5.23,5.23,0,0,0-10.46,0V8.87H8.2a1.63,1.63,0,0,0-1.63,1.62V21.32A1.62,1.62,0,0,0,8.2,22.94H19.8a1.62,1.62,0,0,0,1.63-1.62V10.49A1.63,1.63,0,0,0,19.8,8.87ZM10.93,6.73a3,3,0,1,1,6.06,0V8.87H10.93Zm3,14.15a5,5,0,1,1,5-5A5,5,0,0,1,14,20.88Z", transform: "translate(-0.5 -1.5)" }), index.h("path", { d: "M14,12.62a3.29,3.29,0,1,0,3.29,3.29A3.29,3.29,0,0,0,14,12.62Zm0,4.75a1.47,1.47,0,1,1,1.47-1.46A1.46,1.46,0,0,1,14,17.37Z", transform: "translate(-0.5 -1.5)" }));
|
|
199
|
+
}
|
|
200
|
+
formatValues() {
|
|
201
|
+
let formattedValue = this.value;
|
|
202
|
+
let formattedCurrentValue = this.currentValue;
|
|
203
|
+
if (this.formatFn) {
|
|
204
|
+
formattedValue = this.formatFn(this.value);
|
|
205
|
+
formattedCurrentValue = this.formatFn(this.currentValue);
|
|
206
|
+
}
|
|
207
|
+
if (Array.isArray(this.value)) {
|
|
208
|
+
formattedValue = this.value.join(', ');
|
|
209
|
+
}
|
|
210
|
+
if (Array.isArray(this.currentValue)) {
|
|
211
|
+
formattedCurrentValue = this.currentValue.join(', ');
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
formattedValue: (formattedValue ? (index.h("span", null, formattedValue)) : (index.h("span", null))),
|
|
215
|
+
formattedCurrentValue: (formattedCurrentValue ? (index.h("span", null, formattedCurrentValue)) : (index.h("span", null)))
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
get el() { return index.getElement(this); }
|
|
219
|
+
static get watchers() { return {
|
|
220
|
+
"value": ["onValueChange"]
|
|
221
|
+
}; }
|
|
222
|
+
};
|
|
223
|
+
EditableField.style = editableFieldCss;
|
|
224
|
+
|
|
225
|
+
exports.wcs_editable_field = EditableField;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
const errorCss = ":host{margin-top:0.25rem;color:var(--wcs-red)}";
|
|
8
|
+
|
|
9
|
+
let Label = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (index.h(index.Host, { slot: "error" }, index.h("slot", null)));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
Label.style = errorCss;
|
|
18
|
+
|
|
19
|
+
const formFieldCss = ":host{--wcs-form-field-border-radius-left:var(--wcs-border-radius);--wcs-form-field-border-radius-right:var(--wcs-border-radius);display:flex;flex-direction:column}.input-container{display:flex}::slotted(wcs-radio-group){margin-left:var(--wcs-base-margin)}::slotted(wcs-radio-group[mode=option]){margin-left:0}::slotted(wcs-select:not([slot=prefix])){width:100%}::slotted(label){font-weight:500;margin-bottom:8px}:host(.has-prefix){--wcs-input-border-radius-left:0}:host(.has-suffix){--wcs-input-border-radius-right:0}::slotted([slot=prefix]){--wcs-select-border-radius:var(--wcs-border-radius) 0 0 var(--wcs-border-radius);--wcs-select-background-color:var(--wcs-gray-light);--wcs-select-value-color:var(--wcs-white);--wcs-select-placeholder-color:var(--wcs-white);--wcs-select-border-color:var(--wcs-gray-light)}::slotted([slot=suffix]){--wcs-button-border-radius:0 var(--wcs-border-radius) var(--wcs-border-radius) 0}";
|
|
20
|
+
|
|
21
|
+
let FormField = class {
|
|
22
|
+
constructor(hostRef) {
|
|
23
|
+
index.registerInstance(this, hostRef);
|
|
24
|
+
/**
|
|
25
|
+
* Specifies whether the form field is in an error state. Displays the field border in red and the message contained in the wcs-error component
|
|
26
|
+
*/
|
|
27
|
+
this.isError = false;
|
|
28
|
+
this.hasPrefix = false;
|
|
29
|
+
this.hasSuffix = false;
|
|
30
|
+
}
|
|
31
|
+
componentWillLoad() {
|
|
32
|
+
this.hasSuffix = this.el.querySelector('wcs-button') !== null;
|
|
33
|
+
this.hasPrefix = this.el.querySelector('wcs-select') !== null;
|
|
34
|
+
}
|
|
35
|
+
componentDidLoad() {
|
|
36
|
+
this.initSpiedElement();
|
|
37
|
+
this.addRequiredMarkerToLabel();
|
|
38
|
+
this.updateErrorStateOnInput(this.isError);
|
|
39
|
+
}
|
|
40
|
+
isErrorChange(newValue) {
|
|
41
|
+
this.updateErrorStateOnInput(newValue);
|
|
42
|
+
}
|
|
43
|
+
updateErrorStateOnInput(newValue) {
|
|
44
|
+
if (this.spiedElementIsOfType('wcs-input', 'wcs-textarea')) {
|
|
45
|
+
if (newValue) {
|
|
46
|
+
this.spiedElement.setAttribute('state', 'error');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.spiedElement.setAttribute('state', 'initial');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* This function return true if the form field contains an element with tagName matches a value of the types param
|
|
55
|
+
* @param types
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
spiedElementIsOfType(...types) {
|
|
59
|
+
var _a;
|
|
60
|
+
for (const type of types) {
|
|
61
|
+
if (((_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.tagName) === type.toUpperCase())
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
addRequiredMarkerToLabel() {
|
|
67
|
+
var _a;
|
|
68
|
+
// TODO: deprecate this in favor of the 'required' component attribute
|
|
69
|
+
const label = this.el.querySelector('wcs-label');
|
|
70
|
+
this.observer = new MutationObserver(mutations => {
|
|
71
|
+
var _a;
|
|
72
|
+
const requiredAttMutation = mutations.filter(m => m.attributeName === 'required')[0];
|
|
73
|
+
if (requiredAttMutation) {
|
|
74
|
+
this.updateLabelRequiredFlag((_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.hasAttribute('required'), label);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
if (this.spiedElement) {
|
|
78
|
+
this.observer.observe(this.spiedElement, { attributes: true });
|
|
79
|
+
}
|
|
80
|
+
const isRequired = (_a = this.spiedElement) === null || _a === void 0 ? void 0 : _a.hasAttribute('required');
|
|
81
|
+
this.updateLabelRequiredFlag(isRequired, label);
|
|
82
|
+
}
|
|
83
|
+
initSpiedElement() {
|
|
84
|
+
var _a;
|
|
85
|
+
const SUPPORTED_COMPONENTS = ['wcs-input', 'wcs-select', 'wcs-textarea', 'wcs-radio-group', 'wcs-switch', 'wcs-checkbox'];
|
|
86
|
+
this.spiedElement = (_a = this.el.shadowRoot.querySelector('slot:not([name])')) === null || _a === void 0 ? void 0 : _a.assignedElements()[0];
|
|
87
|
+
// If the component is used in another web component
|
|
88
|
+
if (this.spiedElement.tagName === 'SLOT') {
|
|
89
|
+
this.spiedElement = (this.spiedElement
|
|
90
|
+
.assignedElements()
|
|
91
|
+
.filter(n => SUPPORTED_COMPONENTS.map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0]);
|
|
92
|
+
}
|
|
93
|
+
if (!this.spiedElement)
|
|
94
|
+
throw new Error('You must provide a slotted element in form field');
|
|
95
|
+
if (SUPPORTED_COMPONENTS
|
|
96
|
+
.map(x => x.toUpperCase())
|
|
97
|
+
.indexOf(this.spiedElement.tagName) === -1) {
|
|
98
|
+
// tslint:disable-next-line:no-console
|
|
99
|
+
console.warn('form-field component support ' + SUPPORTED_COMPONENTS.toString() + '. Some features may not work with the provided component (component ' + this.spiedElement.tagName + ' not natively supported).');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
updateLabelRequiredFlag(isRequired, label) {
|
|
103
|
+
if (isRequired && label) {
|
|
104
|
+
label.setAttribute('required', 'true');
|
|
105
|
+
}
|
|
106
|
+
else if (!isRequired && label) {
|
|
107
|
+
label.removeAttribute('required');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
disconnectedCallback() {
|
|
111
|
+
this.observer.disconnect();
|
|
112
|
+
}
|
|
113
|
+
render() {
|
|
114
|
+
let classes = '';
|
|
115
|
+
const isError = this.isError;
|
|
116
|
+
if (this.hasSuffix) {
|
|
117
|
+
classes += ' has-suffix';
|
|
118
|
+
}
|
|
119
|
+
if (this.hasPrefix) {
|
|
120
|
+
classes += ' has-prefix';
|
|
121
|
+
}
|
|
122
|
+
return (index.h(index.Host, { class: classes }, index.h("slot", { name: "label" }), index.h("div", { class: "input-container" }, index.h("slot", { name: "prefix" }), index.h("slot", { onSlotchange: () => this.onFormInputSlotChange() }), index.h("slot", { name: "suffix" })), isError ? (index.h("slot", { name: "error" })) : '', index.h("slot", { name: "messages" })));
|
|
123
|
+
}
|
|
124
|
+
onFormInputSlotChange() {
|
|
125
|
+
this.initSpiedElement();
|
|
126
|
+
this.addRequiredMarkerToLabel();
|
|
127
|
+
this.updateErrorStateOnInput(this.isError);
|
|
128
|
+
}
|
|
129
|
+
get el() { return index.getElement(this); }
|
|
130
|
+
static get watchers() { return {
|
|
131
|
+
"isError": ["isErrorChange"]
|
|
132
|
+
}; }
|
|
133
|
+
};
|
|
134
|
+
FormField.style = formFieldCss;
|
|
135
|
+
|
|
136
|
+
exports.wcs_error = Label;
|
|
137
|
+
exports.wcs_form_field = FormField;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
let FieldContent = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (index.h(index.Host, { slot: "content" }, index.h("slot", null)));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.wcs_field_content = FieldContent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
let FieldLabel = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (index.h(index.Host, { slot: "label" }, index.h("slot", null)));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.wcs_field_label = FieldLabel;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
const fieldCss = ":host{display:flex;flex-direction:column;margin-top:var(--wcs-base-margin);margin-bottom:calc(var(--wcs-base-margin) * 2)}::slotted([slot=label]){font-size:1rem;line-height:1.375;font-weight:500;margin-bottom:calc(var(--wcs-base-margin) / 2);color:var(--wcs-gray-light)}::slotted([slot=content]){font-size:1rem;font-weight:400;color:var(--wcs-gray-light)}";
|
|
8
|
+
|
|
9
|
+
let Field = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (index.h(index.Host, null, index.h("slot", { name: "label" }), index.h("slot", { name: "content" })));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
Field.style = fieldCss;
|
|
18
|
+
|
|
19
|
+
exports.wcs_field = Field;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
const footerCss = ":host{display:block;width:100%;background-color:var(--wcs-gray);color:white}:host .end{margin-top:calc(2 * var(--wcs-base-margin));width:100%;display:flex;justify-content:space-between;align-items:center}:host .end slot[name=end-left]::slotted(a){color:var(--wcs-text-disabled);text-decoration:none;font-size:14px;font-weight:500;margin-right:35px}:host .end slot[name=end-left]::slotted(a:hover){color:var(--wcs-white)}:host .container{margin:0 auto;max-width:var(--wcs-com-content-max-width);display:flex;flex-direction:column;padding:20px}";
|
|
8
|
+
|
|
9
|
+
let Footer = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (index.h(index.Host, null, index.h("div", { class: "container" }, index.h("div", null, index.h("slot", null)), index.h("div", { class: "end" }, index.h("div", null, index.h("slot", { name: "end-left" })), index.h("div", null, index.h("slot", { name: "end-right" }))))));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
Footer.style = footerCss;
|
|
18
|
+
|
|
19
|
+
exports.wcs_footer = Footer;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
const helpers = require('./helpers-6abce594.js');
|
|
7
|
+
const popper = require('./popper-5777994b.js');
|
|
8
|
+
|
|
9
|
+
const galacticMenuCss = "#menu{background-color:var(--wcs-gray);color:white;display:none;padding:var(--wcs-padding)}#menu[data-show]{display:block;z-index:9999}#menu[data-popper-placement^=top]>#arrow{bottom:-4px}#menu[data-popper-placement^=bottom]>#arrow{top:-4px}#menu[data-popper-placement^=left]>#arrow{right:-4px}#menu[data-popper-placement^=right]>#arrow{left:-4px}:host{display:flex;align-items:center;height:32px;padding-left:var(--wcs-padding);background-color:var(--wcs-gray-light)}#toggle-menu-icon{cursor:pointer;padding:0 var(--wcs-padding);user-select:none}#arrow,#arrow::before{position:absolute;width:8px;height:8px;background:inherit}#arrow{visibility:hidden}#arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}";
|
|
10
|
+
|
|
11
|
+
let Galactic = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.showPopoverMenu = false;
|
|
15
|
+
}
|
|
16
|
+
componentDidLoad() {
|
|
17
|
+
this.menu = this.el.shadowRoot.getElementById('toggle-menu-icon');
|
|
18
|
+
this.tooltip = this.el.shadowRoot.getElementById('menu');
|
|
19
|
+
this.popper = popper.createPopper(this.menu, this.tooltip, {
|
|
20
|
+
placement: 'bottom-end',
|
|
21
|
+
modifiers: [
|
|
22
|
+
{
|
|
23
|
+
name: 'offset',
|
|
24
|
+
options: {
|
|
25
|
+
offset: [0, 8]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
onWindowClickEvent(event) {
|
|
32
|
+
if (helpers.clickInsideElement(event, this.tooltip) || helpers.clickInsideElement(event, this.menu)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (this.showPopoverMenu) {
|
|
37
|
+
this.toogleMenu();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
toogleMenu() {
|
|
42
|
+
this.showPopoverMenu = !this.showPopoverMenu;
|
|
43
|
+
}
|
|
44
|
+
componentDidRender() {
|
|
45
|
+
if (this.popper) {
|
|
46
|
+
this.popper.update();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return (index.h(index.Host, null, index.h("span", null, this.text), index.h("wcs-mat-icon", { id: "toggle-menu-icon", icon: "more_horiz", size: "m", onClick: _ => {
|
|
51
|
+
this.toogleMenu();
|
|
52
|
+
} }), index.h("span", { id: "menu", "data-show": this.showPopoverMenu }, index.h("div", { id: "arrow", "data-popper-arrow": true }), index.h("slot", null))));
|
|
53
|
+
}
|
|
54
|
+
get el() { return index.getElement(this); }
|
|
55
|
+
};
|
|
56
|
+
Galactic.style = galacticMenuCss;
|
|
57
|
+
|
|
58
|
+
exports.wcs_galactic_menu = Galactic;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
const galacticCss = ":host{display:block;background-color:var(--wcs-gray)}.container{height:32px;align-items:center;justify-content:space-between;color:var(--wcs-white);font-size:14px;display:flex;max-width:var(--wcs-com-content-max-width);margin:0 auto}.container #sncf-logo{height:32px;margin-right:20px}.container .container-left{display:flex;align-items:center}";
|
|
8
|
+
|
|
9
|
+
let Galactic = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.show = false;
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return (index.h(index.Host, null, index.h("div", { class: "container" }, index.h("div", { class: "container-left" }, index.h("img", { src: SNCF_BASE64_SVG_LOGO, id: "sncf-logo", alt: "Logo SNCF" }), index.h("span", null, this.text)), index.h("div", { class: "menu" }, index.h("slot", null)))));
|
|
16
|
+
}
|
|
17
|
+
get el() { return index.getElement(this); }
|
|
18
|
+
};
|
|
19
|
+
const SNCF_BASE64_SVG_LOGO = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmVy' +
|
|
20
|
+
'c2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5' +
|
|
21
|
+
'rIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KCTxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHX0dSQURJRU5UIiBncmFkaW' +
|
|
22
|
+
'VudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAiIHkxPSIxNiIgeDI9IjMxLjk1OTMiIHkyPSIxNiI+DQoJCTxzdG9wICBvZmZzZXQ9IjAiIHN0e' +
|
|
23
|
+
'WxlPSJzdG9wLWNvbG9yOiM4MzJGNzAiLz4NCgkJPHN0b3AgIG9mZnNldD0iMC4yNDcyIiBzdHlsZT0ic3RvcC1jb2xvcjojQUMyODdDIi8+DQoJCTxz' +
|
|
24
|
+
'dG9wICBvZmZzZXQ9IjAuODE0NiIgc3R5bGU9InN0b3AtY29sb3I6I0RGMjUzMCIvPg0KCQk8c3RvcCAgb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2x' +
|
|
25
|
+
'vcjojREYyNTMwIi8+DQoJPC9saW5lYXJHcmFkaWVudD4NCgk8cGF0aCBmaWxsPSJ1cmwoI1NWR19HUkFESUVOVCkiIGQ9Ik0wLjYsNy43QzAuMiw3Lj' +
|
|
26
|
+
'csMCw3LjgsMCw4LjJ2MTUuN2MwLDAuMywwLjIsMC41LDAuNSwwLjVoMjhjMC4zLDAsMC41LDAsMC42LTAuNGMwLDAsMi44LTguOSwyLjktOSBjMC4xL' +
|
|
27
|
+
'TAuMywwLTAuNS0wLjMtMC43QzIyLjYsOC41LDguOSw3LjYsMi44LDcuNkMxLjksNy42LDEuMSw3LjYsMC42LDcuN3oiLz4NCgk8cGF0aCBmaWxsPSIj' +
|
|
28
|
+
'RkZGRkZGIiBkPSJNNi40LDE3LjdjLTEtMC41LTEuNy0wLjgtMS42LTEuM0M1LDE1LjgsNi4xLDE1LjYsNywxNS42YzAuNSwwLDAuOCwwLjEsMS4yLDA' +
|
|
29
|
+
'uMmwwLjMtMS4xIGMtMC41LTAuMS0wLjgtMC4xLTEuNC0wLjFjLTEuOSwwLTMuNiwwLjUtNCwxLjZjLTAuNSwxLjMsMC45LDIsMi4yLDIuNmMxLDAuNS' +
|
|
30
|
+
'wxLjgsMC45LDEuNSwxLjVjLTAuMiwwLjUtMC45LDAuNy0yLDAuNyBjLTAuOSwwLTItMC4zLTIuOS0wLjdsLTAuNSwxLjFjMC42LDAuMywyLDAuNywzL' +
|
|
31
|
+
'jEsMC43YzIuMSwwLDMuNS0wLjUsNC4xLTEuN0M5LjMsMTkuMSw3LjcsMTguMyw2LjQsMTcuN3oiLz4NCgk8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJN' +
|
|
32
|
+
'OS4zLDE5LjZDOS4zLDE5LjcsOS4zLDE5LjcsOS4zLDE5LjZjMC4xLDAsMC4xLDAsMC4xLDBjMCwwLDEtMy4yLDEtMy4yYzEuMSwxLjUsMi4xLDMuNSw' +
|
|
33
|
+
'yLjcsNS42aDEuNyBsMC45LTIuN2MwLDAsMCwwLDAuMSwwYzAsMCwwLDAsMC4xLDBjMC4zLDEuNywxLjksMi44LDQuMywyLjhjMS41LDAsMi45LTAuNC' +
|
|
34
|
+
'wzLjItMC42bDAuOS0yLjhoMy40bDAuMy0xLjFoLTMuNGwwLjYtMS44aDQuMSBsMC40LTEuMWgtNS43bC0xLjksNi4xYy0wLjQsMC4xLTAuOSwwLjItM' +
|
|
35
|
+
'S41LDAuMmMtMS4xLDAtMi4xLTAuMy0yLjYtMC45Yy0wLjQtMC41LTAuNS0xLTAuNC0xLjdjMC4yLTEuNiwxLjgtMi42LDMuOC0yLjYgYzAuNCwwLDAu' +
|
|
36
|
+
'OSwwLDEuMywwLjFsMC40LTEuMmMtMC41LTAuMS0xLjEtMC4xLTEuNy0wLjFjLTEuOCwwLTMuNCwwLjYtNC40LDEuN2MwLDAtMC4xLDAtMC4xLDBjMCw' +
|
|
37
|
+
'wLTAuMSwwLDAsMGwwLjUtMS42aC0xLjUgTDE0LDE5LjhjLTAuNS0xLjUtMS42LTMuNS0yLjktNS4xSDkuNWwtMS4yLDMuN0M4LjksMTguOCw5LjEsMT' +
|
|
38
|
+
'kuMiw5LjMsMTkuNnoiLz4NCjwvc3ZnPg0K';
|
|
39
|
+
Galactic.style = galacticCss;
|
|
40
|
+
|
|
41
|
+
exports.wcs_galactic = Galactic;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
const GridSortArrow = ({ state }) => (index.h("svg", { style: { marginLeft: 'auto' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "20", viewBox: "0 0 24 20" },
|
|
8
|
+
index.h("style", { type: "text/css" }, `
|
|
9
|
+
.arrow-group {
|
|
10
|
+
transform-origin: 50% 51%;
|
|
11
|
+
transition: transform 175ms ease-in-out;
|
|
12
|
+
}
|
|
13
|
+
.arrow{
|
|
14
|
+
transition: fill 175ms ease-in-out;
|
|
15
|
+
fill: var(--wcs-text-light);
|
|
16
|
+
}
|
|
17
|
+
.asc {
|
|
18
|
+
transform: scaleY(1) translateY(-6px);
|
|
19
|
+
}
|
|
20
|
+
.desc {
|
|
21
|
+
transform: scaleY(-1) translateY(-6px);
|
|
22
|
+
}
|
|
23
|
+
.active {
|
|
24
|
+
fill: var(--wcs-primary);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
`),
|
|
28
|
+
index.h("g", { fill: "none", class: 'asc arrow-group' },
|
|
29
|
+
index.h("path", { class: (state === 'asc' ? 'active' : '') + ' arrow', d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" }),
|
|
30
|
+
index.h("path", { d: "M0 0h24v24H0z", fill: "none" })),
|
|
31
|
+
index.h("g", { fill: "none", class: 'desc arrow-group' },
|
|
32
|
+
index.h("path", { class: (state === 'desc' ? 'active' : '') + ' arrow', d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" }),
|
|
33
|
+
index.h("path", { d: "M0 0h24v24H0z", fill: "none" }))));
|
|
34
|
+
|
|
35
|
+
const gridColumnCss = ":host{--wcs-grid-column-border-left:solid 1px var(--wcs-text-light);display:contents}:host th{color:var(--wcs-gray-dark);background-color:var(--wcs-light);border-left:var(--wcs-grid-column-border-left);padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);text-align:left}:host th .grid-column-th-content{display:inline-flex;flex-direction:row}:host th .grid-column-th-content span{user-select:none}:host .pointer{cursor:pointer}:host([sort-order=asc]) img{transform:scaleY(1)}:host([sort-order=desc]) img{transform:scaleY(-1)}:host([sort-order=none]) img{display:none}:host([sort-order=none]) th:hover img{display:inline-block}:host([hidden]){display:none !important}";
|
|
36
|
+
|
|
37
|
+
let GridColumn = class {
|
|
38
|
+
constructor(hostRef) {
|
|
39
|
+
index.registerInstance(this, hostRef);
|
|
40
|
+
this.wcsSortChange = index.createEvent(this, "wcsSortChange", 7);
|
|
41
|
+
this.wcsHiddenChange = index.createEvent(this, "wcsHiddenChange", 7);
|
|
42
|
+
this.sort = false;
|
|
43
|
+
this.sortOrder = 'none';
|
|
44
|
+
this.customCells = false;
|
|
45
|
+
this.hidden = false;
|
|
46
|
+
}
|
|
47
|
+
parseMyObjectProp(newValue) {
|
|
48
|
+
this.wcsHiddenChange.emit(newValue);
|
|
49
|
+
}
|
|
50
|
+
sortOrderChange(_) {
|
|
51
|
+
this.emitSortConfig();
|
|
52
|
+
}
|
|
53
|
+
emitSortConfig() {
|
|
54
|
+
if (!this.sort)
|
|
55
|
+
return;
|
|
56
|
+
this.wcsSortChange.emit({
|
|
57
|
+
column: this.el,
|
|
58
|
+
order: this.sortOrder,
|
|
59
|
+
sortFn: this.sortFn
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
render() {
|
|
63
|
+
return (index.h(index.Host, { onClick: this.onSortClick.bind(this), slot: "grid-column" }, index.h("th", { style: { width: this.width }, class: this.sort ? 'pointer' : '' }, index.h("div", { class: "grid-column-th-content" }, index.h("span", null, this.name), this.sort ? index.h(GridSortArrow, { state: this.sortOrder }) : ''))));
|
|
64
|
+
}
|
|
65
|
+
onSortClick() {
|
|
66
|
+
this.sortOrder = this.sortOrder === 'none' || this.sortOrder === 'desc' ? 'asc' : 'desc';
|
|
67
|
+
this.emitSortConfig();
|
|
68
|
+
}
|
|
69
|
+
get el() { return index.getElement(this); }
|
|
70
|
+
static get watchers() { return {
|
|
71
|
+
"hidden": ["parseMyObjectProp"],
|
|
72
|
+
"sortOrder": ["sortOrderChange"]
|
|
73
|
+
}; }
|
|
74
|
+
};
|
|
75
|
+
GridColumn.style = gridColumnCss;
|
|
76
|
+
|
|
77
|
+
exports.wcs_grid_column = GridColumn;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
|
+
|
|
7
|
+
let GridCustomCell = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (index.h(index.Host, { slot: this.columnId + '-' + this.rowId }, index.h("slot", null)));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.wcs_grid_custom_cell = GridCustomCell;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3cb9d725.js');
|
|
6
6
|
|
|
7
7
|
const GridPaginationArrow = ({ active, order, double = false }) => (index.h("svg", { style: { marginLeft: 'auto', cursor: 'pointer' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "20", viewBox: "0 0 24 20" },
|
|
8
8
|
index.h("style", { type: "text/css" }, `
|
|
@@ -38,15 +38,15 @@ const GridPaginationArrow = ({ active, order, double = false }) => (index.h("svg
|
|
|
38
38
|
|
|
39
39
|
const gridPaginationCss = ":host{display:block;border-style:solid none none;border-width:1px;border-color:var(--wcs-text-light)}.container{display:grid;grid-template-columns:auto auto auto;justify-content:space-between;color:var(--wcs-text-medium)}.available-page-sizes{width:auto}.page-management,.page-size,.items-count{display:flex;align-items:center}.pagination-arrow{display:flex}";
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
let GridPagination = class {
|
|
42
42
|
constructor(hostRef) {
|
|
43
43
|
index.registerInstance(this, hostRef);
|
|
44
44
|
this.wcsGridPaginationChange = index.createEvent(this, "wcsGridPaginationChange", 7);
|
|
45
45
|
this.availablePageSizes = [10, 20, 50];
|
|
46
|
-
this.currentPage =
|
|
46
|
+
this.currentPage = 0;
|
|
47
47
|
this.pageSize = this.availablePageSizes[0];
|
|
48
48
|
this.itemsCount = 0;
|
|
49
|
-
this.pageCount =
|
|
49
|
+
this.pageCount = 1;
|
|
50
50
|
}
|
|
51
51
|
lastPage() {
|
|
52
52
|
this.currentPage = this.pageCount - 1;
|