@simplysm/angular 14.1.20 → 14.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controls/button/sd-additional-button.js +2 -2
- package/dist/controls/button/sd-anchor.d.ts.map +1 -1
- package/dist/controls/button/sd-anchor.js +3 -3
- package/dist/controls/button/sd-button.d.ts.map +1 -1
- package/dist/controls/button/sd-button.js +3 -3
- package/dist/controls/button/sd-modal-select-button.d.ts.map +1 -1
- package/dist/controls/button/sd-modal-select-button.js +2 -2
- package/dist/controls/checkbox/sd-checkbox.d.ts.map +1 -1
- package/dist/controls/checkbox/sd-checkbox.js +3 -3
- package/dist/controls/checkbox/sd-switch.d.ts.map +1 -1
- package/dist/controls/checkbox/sd-switch.js +3 -3
- package/dist/controls/collapse/sd-collapse-icon.d.ts +1 -1
- package/dist/controls/collapse/sd-collapse-icon.d.ts.map +1 -1
- package/dist/controls/collapse/sd-collapse-icon.js +2 -2
- package/dist/controls/collapse/sd-collapse.d.ts +1 -1
- package/dist/controls/collapse/sd-collapse.d.ts.map +1 -1
- package/dist/controls/collapse/sd-collapse.js +2 -2
- package/dist/controls/dropdown/sd-dropdown-popup.d.ts.map +1 -1
- package/dist/controls/dropdown/sd-dropdown-popup.js +2 -2
- package/dist/controls/dropdown/sd-dropdown.js +1 -1
- package/dist/controls/gap/sd-gap.d.ts.map +1 -1
- package/dist/controls/gap/sd-gap.js +5 -7
- package/dist/controls/input/sd-date-range-picker.js +2 -2
- package/dist/controls/input/sd-numpad.d.ts.map +1 -1
- package/dist/controls/input/sd-numpad.js +7 -15
- package/dist/controls/input/sd-range.js +2 -2
- package/dist/controls/input/sd-textarea.js +4 -4
- package/dist/controls/input/sd-textfield.d.ts.map +1 -1
- package/dist/controls/input/sd-textfield.js +10 -10
- package/dist/controls/list/sd-list-item.js +43 -43
- package/dist/controls/list/sd-list.js +2 -2
- package/dist/controls/pagination/sd-pagination.d.ts.map +1 -1
- package/dist/controls/pagination/sd-pagination.js +7 -5
- package/dist/controls/select/sd-select-button.d.ts.map +1 -1
- package/dist/controls/select/sd-select-button.js +4 -4
- package/dist/controls/select/sd-select-item.d.ts.map +1 -1
- package/dist/controls/select/sd-select-item.js +3 -3
- package/dist/controls/select/sd-select.d.ts.map +1 -1
- package/dist/controls/select/sd-select.js +10 -19
- package/dist/controls/tab/sd-tab-item.js +2 -2
- package/dist/controls/tab/sd-tab.js +2 -2
- package/dist/core/busy/sd-busy-container.d.ts.map +1 -1
- package/dist/core/busy/sd-busy-container.js +3 -3
- package/dist/core/modal/sd-modal.d.ts.map +1 -1
- package/dist/core/modal/sd-modal.js +3 -3
- package/dist/core/provideSdAngular.d.ts.map +1 -1
- package/dist/core/provideSdAngular.js +31 -10
- package/dist/core/ripple/setupRipple.js +2 -2
- package/dist/core/setupBgTheme.d.ts +0 -1
- package/dist/core/setupBgTheme.d.ts.map +1 -1
- package/dist/core/setupBgTheme.js +3 -4
- package/dist/core/show-effect/setupRevealOnShow.js +1 -1
- package/dist/core/toast/sd-toast-container.js +2 -2
- package/dist/core/toast/sd-toast.d.ts.map +1 -1
- package/dist/core/toast/sd-toast.js +3 -3
- package/dist/core/validation/setupInvalid.js +5 -5
- package/dist/data/crud/sd-base-container.d.ts.map +1 -1
- package/dist/data/crud/sd-base-container.js +50 -52
- package/dist/data/kanban/sd-kanban-board.js +2 -2
- package/dist/data/kanban/sd-kanban-lane.d.ts.map +1 -1
- package/dist/data/kanban/sd-kanban-lane.js +4 -4
- package/dist/data/kanban/sd-kanban.d.ts.map +1 -1
- package/dist/data/kanban/sd-kanban.js +4 -4
- package/dist/data/permission-table/sd-permission-table.d.ts.map +1 -1
- package/dist/data/permission-table/sd-permission-table.js +5 -17
- package/dist/data/shared-data/sd-shared-data-select-list.d.ts.map +1 -1
- package/dist/data/shared-data/sd-shared-data-select-list.js +5 -19
- package/dist/data/shared-data/sd-shared-data-select.d.ts.map +1 -1
- package/dist/data/shared-data/sd-shared-data-select.js +8 -15
- package/dist/data/sheet/sd-sheet-config.modal.d.ts.map +1 -1
- package/dist/data/sheet/sd-sheet-config.modal.js +7 -9
- package/dist/data/sheet/sd-sheet.d.ts.map +1 -1
- package/dist/data/sheet/sd-sheet.js +10 -12
- package/dist/data/sheet/useSheetCellStyling.d.ts.map +1 -1
- package/dist/data/sheet/useSheetCellStyling.js +1 -1
- package/dist/data/state-preset/sd-state-preset.js +5 -5
- package/dist/features/editor/sd-markdown-editor.d.ts.map +1 -1
- package/dist/features/editor/sd-markdown-editor.js +85 -34
- package/dist/features/editor/sd-tiptap-editor.d.ts.map +1 -1
- package/dist/features/editor/sd-tiptap-editor.js +192 -61
- package/dist/features/theme/sd-theme-provider.d.ts +18 -1
- package/dist/features/theme/sd-theme-provider.d.ts.map +1 -1
- package/dist/features/theme/sd-theme-provider.js +21 -4
- package/dist/features/theme/sd-theme-selector.d.ts.map +1 -1
- package/dist/features/theme/sd-theme-selector.js +50 -9
- package/dist/features/theme/wcag-contrast.d.ts +9 -0
- package/dist/features/theme/wcag-contrast.d.ts.map +1 -0
- package/dist/features/theme/wcag-contrast.js +83 -0
- package/dist/features/visual/sd-calendar.js +2 -2
- package/dist/features/visual/sd-label.d.ts.map +1 -1
- package/dist/features/visual/sd-label.js +5 -5
- package/dist/features/visual/sd-note.d.ts.map +1 -1
- package/dist/features/visual/sd-note.js +3 -3
- package/dist/features/visual/sd-progress.d.ts.map +1 -1
- package/dist/features/visual/sd-progress.js +3 -3
- package/dist/index.d.ts +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/layout/sidebar/sd-sidebar-container.d.ts.map +1 -1
- package/dist/layout/sidebar/sd-sidebar-container.js +11 -5
- package/dist/layout/sidebar/sd-sidebar-menu.d.ts.map +1 -1
- package/dist/layout/sidebar/sd-sidebar-menu.js +5 -17
- package/dist/layout/sidebar/sd-sidebar-user.js +32 -32
- package/dist/layout/sidebar/sd-sidebar.d.ts.map +1 -1
- package/dist/layout/sidebar/sd-sidebar.js +3 -3
- package/dist/layout/topbar/sd-topbar-menu.js +5 -5
- package/dist/layout/topbar/sd-topbar.d.ts.map +1 -1
- package/dist/layout/topbar/sd-topbar.js +5 -5
- package/package.json +5 -5
- package/scss/commons/_colors.scss +296 -242
- package/scss/commons/_density.scss +23 -0
- package/scss/commons/_mixins.scss +142 -129
- package/scss/commons/_styles.scss +78 -103
- package/scss/commons/_theme-variables.scss +16 -2
- package/scss/commons/_variables.scss +277 -149
- package/scss/controls/_card.scss +12 -8
- package/scss/controls/_form-box.scss +7 -7
- package/scss/controls/_form-table.scss +7 -7
- package/scss/controls/_table.scss +5 -5
- package/scss/sd-tokens.md +132 -0
- package/scss/styles.scss +3 -4
- package/scss/themes/_variables-blueprint.scss +127 -81
- package/scss/themes/_variables-ide-dark.scss +215 -0
- package/src/controls/button/sd-additional-button.ts +12 -12
- package/src/controls/button/sd-anchor.ts +7 -8
- package/src/controls/button/sd-button.ts +42 -44
- package/src/controls/button/sd-modal-select-button.ts +15 -19
- package/src/controls/checkbox/sd-checkbox.ts +55 -43
- package/src/controls/checkbox/sd-switch.ts +18 -19
- package/src/controls/collapse/sd-collapse-icon.ts +2 -2
- package/src/controls/collapse/sd-collapse.ts +2 -2
- package/src/controls/dropdown/sd-dropdown-popup.ts +10 -12
- package/src/controls/dropdown/sd-dropdown.ts +1 -1
- package/src/controls/gap/sd-gap.ts +11 -9
- package/src/controls/input/sd-date-range-picker.ts +1 -1
- package/src/controls/input/sd-numpad.ts +3 -11
- package/src/controls/input/sd-range.ts +1 -1
- package/src/controls/input/sd-textarea.ts +18 -18
- package/src/controls/input/sd-textfield.ts +39 -37
- package/src/controls/list/sd-list-item.ts +195 -195
- package/src/controls/list/sd-list.ts +8 -8
- package/src/controls/pagination/sd-pagination.ts +4 -2
- package/src/controls/select/sd-select-button.ts +6 -10
- package/src/controls/select/sd-select-item.ts +14 -15
- package/src/controls/select/sd-select.ts +34 -35
- package/src/controls/tab/sd-tab-item.ts +4 -4
- package/src/controls/tab/sd-tab.ts +2 -2
- package/src/core/busy/sd-busy-container.ts +17 -16
- package/src/core/modal/sd-modal.ts +38 -32
- package/src/core/provideSdAngular.ts +34 -10
- package/src/core/ripple/setupRipple.ts +2 -2
- package/src/core/setupBgTheme.ts +5 -14
- package/src/core/show-effect/setupRevealOnShow.ts +1 -1
- package/src/core/toast/sd-toast-container.ts +5 -5
- package/src/core/toast/sd-toast.ts +16 -17
- package/src/core/validation/setupInvalid.ts +5 -5
- package/src/data/crud/sd-base-container.ts +120 -122
- package/src/data/kanban/sd-kanban-board.ts +1 -1
- package/src/data/kanban/sd-kanban-lane.ts +9 -14
- package/src/data/kanban/sd-kanban.ts +9 -19
- package/src/data/permission-table/sd-permission-table.ts +12 -20
- package/src/data/shared-data/sd-shared-data-select-list.ts +5 -19
- package/src/data/shared-data/sd-shared-data-select.ts +11 -28
- package/src/data/sheet/sd-sheet-config.modal.ts +5 -7
- package/src/data/sheet/sd-sheet.ts +29 -28
- package/src/data/sheet/useSheetCellStyling.ts +12 -3
- package/src/data/state-preset/sd-state-preset.ts +16 -16
- package/src/features/editor/sd-markdown-editor.ts +110 -56
- package/src/features/editor/sd-tiptap-editor.ts +214 -81
- package/src/features/theme/sd-theme-provider.ts +28 -3
- package/src/features/theme/sd-theme-selector.ts +21 -2
- package/src/features/theme/wcag-contrast.ts +103 -0
- package/src/features/visual/sd-calendar.ts +8 -8
- package/src/features/visual/sd-label.ts +11 -12
- package/src/features/visual/sd-note.ts +10 -11
- package/src/features/visual/sd-progress.ts +9 -11
- package/src/index.ts +15 -40
- package/src/layout/sidebar/sd-sidebar-container.ts +21 -8
- package/src/layout/sidebar/sd-sidebar-menu.ts +15 -17
- package/src/layout/sidebar/sd-sidebar-user.ts +100 -100
- package/src/layout/sidebar/sd-sidebar.ts +7 -9
- package/src/layout/topbar/sd-topbar-menu.ts +3 -3
- package/src/layout/topbar/sd-topbar.ts +12 -14
- package/styles.css +1641 -2462
- package/scss/themes/_blueprint-surfaces.scss +0 -87
|
@@ -27,7 +27,7 @@ function SdTiptapEditor_Conditional_0_Conditional_48_Template(rf, ctx) { if (rf
|
|
|
27
27
|
i0.ɵɵrepeaterCreate(1, SdTiptapEditor_Conditional_0_Conditional_48_For_2_Template, 1, 3, "button", 24, i0.ɵɵrepeaterTrackByIdentity);
|
|
28
28
|
i0.ɵɵdomElementStart(3, "button", 25);
|
|
29
29
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Conditional_48_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.applyColor(undefined)); });
|
|
30
|
-
i0.ɵɵtext(4, "\u2715");
|
|
30
|
+
i0.ɵɵtext(4, " \u2715 ");
|
|
31
31
|
i0.ɵɵdomElementEnd()();
|
|
32
32
|
} if (rf & 2) {
|
|
33
33
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
@@ -38,27 +38,27 @@ function SdTiptapEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
38
38
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
39
39
|
i0.ɵɵdomElementStart(0, "div", 1)(1, "div", 2)(2, "button", 3);
|
|
40
40
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("h1")); });
|
|
41
|
-
i0.ɵɵtext(3, "H1");
|
|
41
|
+
i0.ɵɵtext(3, " H1 ");
|
|
42
42
|
i0.ɵɵdomElementEnd();
|
|
43
43
|
i0.ɵɵdomElementStart(4, "button", 4);
|
|
44
44
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("h2")); });
|
|
45
|
-
i0.ɵɵtext(5, "H2");
|
|
45
|
+
i0.ɵɵtext(5, " H2 ");
|
|
46
46
|
i0.ɵɵdomElementEnd()();
|
|
47
47
|
i0.ɵɵdomElementStart(6, "div", 2)(7, "button", 5);
|
|
48
48
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("bold")); });
|
|
49
|
-
i0.ɵɵtext(8, "B");
|
|
49
|
+
i0.ɵɵtext(8, " B ");
|
|
50
50
|
i0.ɵɵdomElementEnd();
|
|
51
51
|
i0.ɵɵdomElementStart(9, "button", 6);
|
|
52
52
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("italic")); });
|
|
53
|
-
i0.ɵɵtext(10, "I");
|
|
53
|
+
i0.ɵɵtext(10, " I ");
|
|
54
54
|
i0.ɵɵdomElementEnd();
|
|
55
55
|
i0.ɵɵdomElementStart(11, "button", 7);
|
|
56
56
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("underline")); });
|
|
57
|
-
i0.ɵɵtext(12, "U");
|
|
57
|
+
i0.ɵɵtext(12, " U ");
|
|
58
58
|
i0.ɵɵdomElementEnd();
|
|
59
59
|
i0.ɵɵdomElementStart(13, "button", 8);
|
|
60
60
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_13_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("strike")); });
|
|
61
|
-
i0.ɵɵtext(14, "S");
|
|
61
|
+
i0.ɵɵtext(14, " S ");
|
|
62
62
|
i0.ɵɵdomElementEnd()();
|
|
63
63
|
i0.ɵɵdomElementStart(15, "div", 2)(16, "button", 9);
|
|
64
64
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_16_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleColorPicker("text")); });
|
|
@@ -72,11 +72,11 @@ function SdTiptapEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
72
72
|
i0.ɵɵdomElementEnd()();
|
|
73
73
|
i0.ɵɵdomElementStart(22, "div", 2)(23, "button", 12);
|
|
74
74
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_23_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("bulletList")); });
|
|
75
|
-
i0.ɵɵtext(24, "UL");
|
|
75
|
+
i0.ɵɵtext(24, " UL ");
|
|
76
76
|
i0.ɵɵdomElementEnd();
|
|
77
77
|
i0.ɵɵdomElementStart(25, "button", 13);
|
|
78
78
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_25_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("orderedList")); });
|
|
79
|
-
i0.ɵɵtext(26, "OL");
|
|
79
|
+
i0.ɵɵtext(26, " OL ");
|
|
80
80
|
i0.ɵɵdomElementEnd();
|
|
81
81
|
i0.ɵɵdomElementStart(27, "button", 14);
|
|
82
82
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_27_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("indent")); });
|
|
@@ -88,27 +88,27 @@ function SdTiptapEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
88
88
|
i0.ɵɵdomElementEnd()();
|
|
89
89
|
i0.ɵɵdomElementStart(31, "div", 2)(32, "button", 16);
|
|
90
90
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_32_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("blockquote")); });
|
|
91
|
-
i0.ɵɵtext(33, "\u275D");
|
|
91
|
+
i0.ɵɵtext(33, " \u275D ");
|
|
92
92
|
i0.ɵɵdomElementEnd();
|
|
93
93
|
i0.ɵɵdomElementStart(34, "button", 17);
|
|
94
94
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_34_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("codeBlock")); });
|
|
95
|
-
i0.ɵɵtext(35, "</>");
|
|
95
|
+
i0.ɵɵtext(35, " </> ");
|
|
96
96
|
i0.ɵɵdomElementEnd()();
|
|
97
97
|
i0.ɵɵdomElementStart(36, "div", 2)(37, "button", 18);
|
|
98
98
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_37_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("alignLeft")); });
|
|
99
|
-
i0.ɵɵtext(38, "\u2261L");
|
|
99
|
+
i0.ɵɵtext(38, " \u2261L ");
|
|
100
100
|
i0.ɵɵdomElementEnd();
|
|
101
101
|
i0.ɵɵdomElementStart(39, "button", 19);
|
|
102
102
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_39_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("alignCenter")); });
|
|
103
|
-
i0.ɵɵtext(40, "\u2261C");
|
|
103
|
+
i0.ɵɵtext(40, " \u2261C ");
|
|
104
104
|
i0.ɵɵdomElementEnd();
|
|
105
105
|
i0.ɵɵdomElementStart(41, "button", 20);
|
|
106
106
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_41_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("alignRight")); });
|
|
107
|
-
i0.ɵɵtext(42, "\u2261R");
|
|
107
|
+
i0.ɵɵtext(42, " \u2261R ");
|
|
108
108
|
i0.ɵɵdomElementEnd();
|
|
109
109
|
i0.ɵɵdomElementStart(43, "button", 21);
|
|
110
110
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_43_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("alignJustify")); });
|
|
111
|
-
i0.ɵɵtext(44, "\u2261J");
|
|
111
|
+
i0.ɵɵtext(44, " \u2261J ");
|
|
112
112
|
i0.ɵɵdomElementEnd()();
|
|
113
113
|
i0.ɵɵdomElementStart(45, "div", 2)(46, "button", 22);
|
|
114
114
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_46_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("clean")); });
|
|
@@ -176,11 +176,46 @@ export class SdTiptapEditor {
|
|
|
176
176
|
_elRef = inject(ElementRef);
|
|
177
177
|
_destroyRef = inject(DestroyRef);
|
|
178
178
|
colorPresets = [
|
|
179
|
-
"#000000",
|
|
180
|
-
"#
|
|
181
|
-
"#
|
|
182
|
-
"#
|
|
183
|
-
"#
|
|
179
|
+
"#000000",
|
|
180
|
+
"#434343",
|
|
181
|
+
"#666666",
|
|
182
|
+
"#999999",
|
|
183
|
+
"#b7b7b7",
|
|
184
|
+
"#cccccc",
|
|
185
|
+
"#d9d9d9",
|
|
186
|
+
"#efefef",
|
|
187
|
+
"#f3f3f3",
|
|
188
|
+
"#ffffff",
|
|
189
|
+
"#980000",
|
|
190
|
+
"#ff0000",
|
|
191
|
+
"#ff9900",
|
|
192
|
+
"#ffff00",
|
|
193
|
+
"#00ff00",
|
|
194
|
+
"#00ffff",
|
|
195
|
+
"#4a86e8",
|
|
196
|
+
"#0000ff",
|
|
197
|
+
"#9900ff",
|
|
198
|
+
"#ff00ff",
|
|
199
|
+
"#e6b8af",
|
|
200
|
+
"#f4cccc",
|
|
201
|
+
"#fce5cd",
|
|
202
|
+
"#fff2cc",
|
|
203
|
+
"#d9ead3",
|
|
204
|
+
"#d0e0e3",
|
|
205
|
+
"#c9daf8",
|
|
206
|
+
"#cfe2f3",
|
|
207
|
+
"#d9d2e9",
|
|
208
|
+
"#ead1dc",
|
|
209
|
+
"#dd7e6b",
|
|
210
|
+
"#ea9999",
|
|
211
|
+
"#f9cb9c",
|
|
212
|
+
"#ffe599",
|
|
213
|
+
"#b6d7a8",
|
|
214
|
+
"#a2c4c9",
|
|
215
|
+
"#a4c2f4",
|
|
216
|
+
"#9fc5e8",
|
|
217
|
+
"#b4a7d6",
|
|
218
|
+
"#d5a6bd",
|
|
184
219
|
];
|
|
185
220
|
/** @internal -- TipTap Editor 인스턴스. 테스트 및 고급 사용자용 */
|
|
186
221
|
editor = signal(undefined, /* @ts-ignore */
|
|
@@ -301,7 +336,7 @@ export class SdTiptapEditor {
|
|
|
301
336
|
i0.ɵɵdomElement(1, "div", 0);
|
|
302
337
|
} if (rf & 2) {
|
|
303
338
|
i0.ɵɵconditional(!ctx.disabled() ? 0 : -1);
|
|
304
|
-
} }, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--
|
|
339
|
+
} }, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--sd-bd-field);\n border-radius: var(--sd-radius-default);\n background-color: var(--sd-bg-field);\n}\nsd-tiptap-editor > ._toolbar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--sd-gap-xs);\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group {\n display: flex;\n gap: 1px;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button {\n padding: var(--sd-gap-xs) var(--sd-gap-sm);\n border: 1px solid var(--sd-bd-hairline);\n border-radius: var(--sd-radius-default);\n background-color: transparent;\n cursor: pointer;\n font-size: var(--sd-font-size-default);\n line-height: 1;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active {\n background-color: var(--sd-bg-primary-solid);\n color: var(--sd-tx-primary-solid);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button:hover {\n background-color: var(--sd-bg-state-hover);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active:hover {\n background-color: var(--sd-bg-primary-solid);\n}\nsd-tiptap-editor > ._color-picker {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch {\n width: 1.25rem;\n height: 1.25rem;\n border: 1px solid var(--sd-bd-hairline);\n border-radius: 2px;\n cursor: pointer;\n padding: 0;\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch._no-color {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--sd-bg-control);\n font-size: 0.625rem;\n}\nsd-tiptap-editor > ._editor-container {\n padding: var(--sd-gap-sm);\n min-height: 6.25rem;\n font-family: var(--sd-font-family-field);\n}\nsd-tiptap-editor > ._editor-container > .tiptap {\n outline: none;\n}\nsd-tiptap-editor > ._editor-container > .tiptap:focus {\n outline: none;\n}\nsd-tiptap-editor[data-sd-disabled=true] {\n background-color: var(--sd-bg-disabled);\n color: var(--sd-tx-disabled);\n}\nsd-tiptap-editor[data-sd-disabled=true] > ._editor-container > .tiptap {\n cursor: not-allowed;\n}\nsd-tiptap-editor[data-sd-readonly=true] > ._editor-container > .tiptap {\n cursor: default;\n}\nsd-tiptap-editor ._color-btn {\n position: relative;\n}\nsd-tiptap-editor ._color-btn > ._color-indicator {\n display: block;\n height: 2px;\n width: 100%;\n position: absolute;\n bottom: 2px;\n left: 0;\n}"], encapsulation: 2 });
|
|
305
340
|
}
|
|
306
341
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SdTiptapEditor, [{
|
|
307
342
|
type: Component,
|
|
@@ -309,56 +344,148 @@ export class SdTiptapEditor {
|
|
|
309
344
|
@if (!disabled()) {
|
|
310
345
|
<div class="_toolbar">
|
|
311
346
|
<div class="_btn-group">
|
|
312
|
-
<button
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
347
|
+
<button
|
|
348
|
+
type="button"
|
|
349
|
+
data-cmd="h1"
|
|
350
|
+
[class._active]="activeStates().h1"
|
|
351
|
+
(click)="execCmd('h1')"
|
|
352
|
+
>
|
|
353
|
+
H1
|
|
354
|
+
</button>
|
|
355
|
+
<button
|
|
356
|
+
type="button"
|
|
357
|
+
data-cmd="h2"
|
|
358
|
+
[class._active]="activeStates().h2"
|
|
359
|
+
(click)="execCmd('h2')"
|
|
360
|
+
>
|
|
361
|
+
H2
|
|
362
|
+
</button>
|
|
316
363
|
</div>
|
|
317
364
|
<div class="_btn-group">
|
|
318
|
-
<button
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
365
|
+
<button
|
|
366
|
+
type="button"
|
|
367
|
+
data-cmd="bold"
|
|
368
|
+
[class._active]="activeStates().bold"
|
|
369
|
+
(click)="execCmd('bold')"
|
|
370
|
+
>
|
|
371
|
+
B
|
|
372
|
+
</button>
|
|
373
|
+
<button
|
|
374
|
+
type="button"
|
|
375
|
+
data-cmd="italic"
|
|
376
|
+
[class._active]="activeStates().italic"
|
|
377
|
+
(click)="execCmd('italic')"
|
|
378
|
+
>
|
|
379
|
+
I
|
|
380
|
+
</button>
|
|
381
|
+
<button
|
|
382
|
+
type="button"
|
|
383
|
+
data-cmd="underline"
|
|
384
|
+
[class._active]="activeStates().underline"
|
|
385
|
+
(click)="execCmd('underline')"
|
|
386
|
+
>
|
|
387
|
+
U
|
|
388
|
+
</button>
|
|
389
|
+
<button
|
|
390
|
+
type="button"
|
|
391
|
+
data-cmd="strike"
|
|
392
|
+
[class._active]="activeStates().strike"
|
|
393
|
+
(click)="execCmd('strike')"
|
|
394
|
+
>
|
|
395
|
+
S
|
|
396
|
+
</button>
|
|
326
397
|
</div>
|
|
327
398
|
<div class="_btn-group">
|
|
328
|
-
<button
|
|
329
|
-
|
|
399
|
+
<button
|
|
400
|
+
type="button"
|
|
401
|
+
data-cmd="textColor"
|
|
402
|
+
class="_color-btn"
|
|
403
|
+
(click)="toggleColorPicker('text')"
|
|
404
|
+
>
|
|
330
405
|
<span class="_color-indicator" [style.background-color]="activeColor()"></span>
|
|
331
406
|
A
|
|
332
407
|
</button>
|
|
333
|
-
<button
|
|
334
|
-
|
|
408
|
+
<button
|
|
409
|
+
type="button"
|
|
410
|
+
data-cmd="bgColor"
|
|
411
|
+
class="_color-btn"
|
|
412
|
+
(click)="toggleColorPicker('bg')"
|
|
413
|
+
>
|
|
335
414
|
<span class="_color-indicator" [style.background-color]="activeBgColor()"></span>
|
|
336
415
|
BG
|
|
337
416
|
</button>
|
|
338
417
|
</div>
|
|
339
418
|
<div class="_btn-group">
|
|
340
|
-
<button
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
419
|
+
<button
|
|
420
|
+
type="button"
|
|
421
|
+
data-cmd="bulletList"
|
|
422
|
+
[class._active]="activeStates().bulletList"
|
|
423
|
+
(click)="execCmd('bulletList')"
|
|
424
|
+
>
|
|
425
|
+
UL
|
|
426
|
+
</button>
|
|
427
|
+
<button
|
|
428
|
+
type="button"
|
|
429
|
+
data-cmd="orderedList"
|
|
430
|
+
[class._active]="activeStates().orderedList"
|
|
431
|
+
(click)="execCmd('orderedList')"
|
|
432
|
+
>
|
|
433
|
+
OL
|
|
434
|
+
</button>
|
|
344
435
|
<button type="button" data-cmd="indent" (click)="execCmd('indent')">→</button>
|
|
345
436
|
<button type="button" data-cmd="outdent" (click)="execCmd('outdent')">←</button>
|
|
346
437
|
</div>
|
|
347
438
|
<div class="_btn-group">
|
|
348
|
-
<button
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
439
|
+
<button
|
|
440
|
+
type="button"
|
|
441
|
+
data-cmd="blockquote"
|
|
442
|
+
[class._active]="activeStates().blockquote"
|
|
443
|
+
(click)="execCmd('blockquote')"
|
|
444
|
+
>
|
|
445
|
+
❝
|
|
446
|
+
</button>
|
|
447
|
+
<button
|
|
448
|
+
type="button"
|
|
449
|
+
data-cmd="codeBlock"
|
|
450
|
+
[class._active]="activeStates().codeBlock"
|
|
451
|
+
(click)="execCmd('codeBlock')"
|
|
452
|
+
>
|
|
453
|
+
</>
|
|
454
|
+
</button>
|
|
352
455
|
</div>
|
|
353
456
|
<div class="_btn-group">
|
|
354
|
-
<button
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
457
|
+
<button
|
|
458
|
+
type="button"
|
|
459
|
+
data-cmd="alignLeft"
|
|
460
|
+
[class._active]="activeStates().alignLeft"
|
|
461
|
+
(click)="execCmd('alignLeft')"
|
|
462
|
+
>
|
|
463
|
+
≡L
|
|
464
|
+
</button>
|
|
465
|
+
<button
|
|
466
|
+
type="button"
|
|
467
|
+
data-cmd="alignCenter"
|
|
468
|
+
[class._active]="activeStates().alignCenter"
|
|
469
|
+
(click)="execCmd('alignCenter')"
|
|
470
|
+
>
|
|
471
|
+
≡C
|
|
472
|
+
</button>
|
|
473
|
+
<button
|
|
474
|
+
type="button"
|
|
475
|
+
data-cmd="alignRight"
|
|
476
|
+
[class._active]="activeStates().alignRight"
|
|
477
|
+
(click)="execCmd('alignRight')"
|
|
478
|
+
>
|
|
479
|
+
≡R
|
|
480
|
+
</button>
|
|
481
|
+
<button
|
|
482
|
+
type="button"
|
|
483
|
+
data-cmd="alignJustify"
|
|
484
|
+
[class._active]="activeStates().alignJustify"
|
|
485
|
+
(click)="execCmd('alignJustify')"
|
|
486
|
+
>
|
|
487
|
+
≡J
|
|
488
|
+
</button>
|
|
362
489
|
</div>
|
|
363
490
|
<div class="_btn-group">
|
|
364
491
|
<button type="button" data-cmd="clean" (click)="execCmd('clean')">Tx</button>
|
|
@@ -367,13 +494,17 @@ export class SdTiptapEditor {
|
|
|
367
494
|
@if (colorPickerMode() != undefined) {
|
|
368
495
|
<div class="_color-picker">
|
|
369
496
|
@for (color of colorPresets; track color) {
|
|
370
|
-
<button
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
497
|
+
<button
|
|
498
|
+
type="button"
|
|
499
|
+
class="_color-swatch"
|
|
500
|
+
[style.background-color]="color"
|
|
501
|
+
[attr.aria-label]="color"
|
|
502
|
+
(click)="applyColor(color)"
|
|
503
|
+
></button>
|
|
374
504
|
}
|
|
375
|
-
<button type="button" class="_color-swatch _no-color"
|
|
376
|
-
|
|
505
|
+
<button type="button" class="_color-swatch _no-color" (click)="applyColor(undefined)">
|
|
506
|
+
✕
|
|
507
|
+
</button>
|
|
377
508
|
</div>
|
|
378
509
|
}
|
|
379
510
|
}
|
|
@@ -381,6 +512,6 @@ export class SdTiptapEditor {
|
|
|
381
512
|
`, host: {
|
|
382
513
|
"[attr.data-sd-disabled]": "disabled()",
|
|
383
514
|
"[attr.data-sd-readonly]": "readonly()",
|
|
384
|
-
}, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--
|
|
515
|
+
}, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--sd-bd-field);\n border-radius: var(--sd-radius-default);\n background-color: var(--sd-bg-field);\n}\nsd-tiptap-editor > ._toolbar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--sd-gap-xs);\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group {\n display: flex;\n gap: 1px;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button {\n padding: var(--sd-gap-xs) var(--sd-gap-sm);\n border: 1px solid var(--sd-bd-hairline);\n border-radius: var(--sd-radius-default);\n background-color: transparent;\n cursor: pointer;\n font-size: var(--sd-font-size-default);\n line-height: 1;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active {\n background-color: var(--sd-bg-primary-solid);\n color: var(--sd-tx-primary-solid);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button:hover {\n background-color: var(--sd-bg-state-hover);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active:hover {\n background-color: var(--sd-bg-primary-solid);\n}\nsd-tiptap-editor > ._color-picker {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch {\n width: 1.25rem;\n height: 1.25rem;\n border: 1px solid var(--sd-bd-hairline);\n border-radius: 2px;\n cursor: pointer;\n padding: 0;\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch._no-color {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--sd-bg-control);\n font-size: 0.625rem;\n}\nsd-tiptap-editor > ._editor-container {\n padding: var(--sd-gap-sm);\n min-height: 6.25rem;\n font-family: var(--sd-font-family-field);\n}\nsd-tiptap-editor > ._editor-container > .tiptap {\n outline: none;\n}\nsd-tiptap-editor > ._editor-container > .tiptap:focus {\n outline: none;\n}\nsd-tiptap-editor[data-sd-disabled=true] {\n background-color: var(--sd-bg-disabled);\n color: var(--sd-tx-disabled);\n}\nsd-tiptap-editor[data-sd-disabled=true] > ._editor-container > .tiptap {\n cursor: not-allowed;\n}\nsd-tiptap-editor[data-sd-readonly=true] > ._editor-container > .tiptap {\n cursor: default;\n}\nsd-tiptap-editor ._color-btn {\n position: relative;\n}\nsd-tiptap-editor ._color-btn > ._color-indicator {\n display: block;\n height: 2px;\n width: 100%;\n position: absolute;\n bottom: 2px;\n left: 0;\n}"] }]
|
|
385
516
|
}], () => [], { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], validatorFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "validatorFn", required: false }] }], extensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "extensions", required: false }] }] }); })();
|
|
386
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdTiptapEditor, { className: "SdTiptapEditor", filePath: "packages/angular/src/features/editor/sd-tiptap-editor.ts", lineNumber:
|
|
517
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdTiptapEditor, { className: "SdTiptapEditor", filePath: "packages/angular/src/features/editor/sd-tiptap-editor.ts", lineNumber: 335 }); })();
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
+
export declare const SD_THEMES: readonly [{
|
|
3
|
+
readonly value: "light";
|
|
4
|
+
readonly label: "라이트";
|
|
5
|
+
}, {
|
|
6
|
+
readonly value: "blueprint";
|
|
7
|
+
readonly label: "블루프린트";
|
|
8
|
+
}, {
|
|
9
|
+
readonly value: "ide-dark";
|
|
10
|
+
readonly label: "IDE 다크";
|
|
11
|
+
}];
|
|
12
|
+
export type SdThemeName = (typeof SD_THEMES)[number]["value"];
|
|
13
|
+
export type SdDensity = "normal" | "compact";
|
|
2
14
|
export declare class SdThemeProvider {
|
|
3
|
-
|
|
15
|
+
readonly themes: readonly {
|
|
16
|
+
value: SdThemeName;
|
|
17
|
+
label: string;
|
|
18
|
+
}[];
|
|
19
|
+
theme: import("@angular/core").WritableSignal<"light" | "blueprint" | "ide-dark">;
|
|
20
|
+
density: import("@angular/core").WritableSignal<SdDensity>;
|
|
4
21
|
readonly fontSizePresets: readonly number[];
|
|
5
22
|
fontSize: import("@angular/core").WritableSignal<number>;
|
|
6
23
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-theme-provider.d.ts","sourceRoot":"","sources":["../../../src/features/theme/sd-theme-provider.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"sd-theme-provider.d.ts","sourceRoot":"","sources":["../../../src/features/theme/sd-theme-provider.ts"],"names":[],"mappings":";AAMA,eAAO,MAAM,SAAS;;;;;;;;;EAIZ,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAG9D,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7C,qBACa,eAAe;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS;QAAE,KAAK,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAa;IAG9E,KAAK,6EAAgC;IAErC,OAAO,oDAA+B;IAEtC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAA4B;IAEvE,QAAQ,iDAAsB;;IAsB9B,gBAAgB,IAAI,IAAI;IAOxB,gBAAgB,IAAI,IAAI;yCAvCb,eAAe;6CAAf,eAAe;CAmD3B"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { effect, inject, Injectable, PLATFORM_ID, signal } from "@angular/core";
|
|
2
2
|
import { isPlatformBrowser } from "@angular/common";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
// 내장 테마 단일 정의 — 새 테마 추가 시 여기 항목 1줄 +
|
|
5
|
+
// scss/themes 값 맵 + _theme-variables 의 .sd-theme-{value} writeVars 블록만 추가하면 된다.
|
|
6
|
+
// light 는 :root 기본값이라 값 맵/블록이 없어도 동작한다(클래스가 붙어도 규칙이 없어 무효).
|
|
7
|
+
export const SD_THEMES = [
|
|
8
|
+
{ value: "light", label: "라이트" },
|
|
9
|
+
{ value: "blueprint", label: "블루프린트" },
|
|
10
|
+
{ value: "ide-dark", label: "IDE 다크" },
|
|
11
|
+
];
|
|
4
12
|
export class SdThemeProvider {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
themes = SD_THEMES;
|
|
14
|
+
// 라이트(기본) / 블루프린트(도면) / IDE 다크
|
|
15
|
+
theme = signal("light", /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
|
|
17
|
+
density = signal("normal", /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
|
|
8
19
|
fontSizePresets = [12, 14, 16, 20, 24, 28];
|
|
9
20
|
fontSize = signal(12, /* @ts-ignore */
|
|
10
21
|
...(ngDevMode ? [{ debugName: "fontSize" }] : /* istanbul ignore next */ []));
|
|
@@ -13,7 +24,13 @@ export class SdThemeProvider {
|
|
|
13
24
|
if (!isPlatformBrowser(inject(PLATFORM_ID)))
|
|
14
25
|
return;
|
|
15
26
|
effect(() => {
|
|
16
|
-
|
|
27
|
+
const theme = this.theme();
|
|
28
|
+
for (const def of this.themes) {
|
|
29
|
+
document.body.classList.toggle(`sd-theme-${def.value}`, def.value === theme);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
effect(() => {
|
|
33
|
+
document.body.classList.toggle("sd-density-compact", this.density() === "compact");
|
|
17
34
|
});
|
|
18
35
|
effect(() => {
|
|
19
36
|
document.documentElement.style.fontSize = `${this.fontSize()}px`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-theme-selector.d.ts","sourceRoot":"","sources":["../../../src/features/theme/sd-theme-selector.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;;AAGtD,
|
|
1
|
+
{"version":3,"file":"sd-theme-selector.d.ts","sourceRoot":"","sources":["../../../src/features/theme/sd-theme-selector.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;;AAGtD,qBAkEa,eAAe;IAC1B,SAAS,CAAC,QAAQ,CAAC,QAAQ,kBAA2B;IAEtD,aAAa,0CAAgF;IAE7F,aAAa,0CAIX;IAEF,SAAS,CAAC,QAAQ,CAAC,UAAU,uVAAc;IAC3C,SAAS,CAAC,QAAQ,CAAC,WAAW,yTAAe;IAC7C,SAAS,CAAC,QAAQ,CAAC,aAAa,uoBAAiB;yCAbtC,eAAe;2CAAf,eAAe;CAc3B"}
|
|
@@ -7,6 +7,20 @@ import { NgIcon } from "@ng-icons/core";
|
|
|
7
7
|
import { SdThemeProvider } from "./sd-theme-provider";
|
|
8
8
|
import { tablerMinus, tablerPalette, tablerPlus } from "@ng-icons/tabler-icons";
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
+
const _forTrack0 = ($index, $item) => $item.value;
|
|
11
|
+
function SdThemeSelector_For_20_Template(rf, ctx) { if (rf & 1) {
|
|
12
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
13
|
+
i0.ɵɵelementStart(0, "sd-button", 8);
|
|
14
|
+
i0.ɵɵlistener("click", function SdThemeSelector_For_20_Template_sd_button_click_0_listener() { const item_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2._sdTheme.theme.set(item_r2.value)); });
|
|
15
|
+
i0.ɵɵtext(1);
|
|
16
|
+
i0.ɵɵelementEnd();
|
|
17
|
+
} if (rf & 2) {
|
|
18
|
+
const item_r2 = ctx.$implicit;
|
|
19
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
20
|
+
i0.ɵɵproperty("inline", true)("size", "sm")("theme", ctx_r2._sdTheme.theme() === item_r2.value ? "primary" : "link-gray");
|
|
21
|
+
i0.ɵɵadvance();
|
|
22
|
+
i0.ɵɵtextInterpolate1(" ", item_r2.label, " ");
|
|
23
|
+
} }
|
|
10
24
|
export class SdThemeSelector {
|
|
11
25
|
_sdTheme = inject(SdThemeProvider);
|
|
12
26
|
isMinFontSize = computed(() => this._sdTheme.fontSize() <= this._sdTheme.fontSizePresets[0], /* @ts-ignore */
|
|
@@ -18,7 +32,7 @@ export class SdThemeSelector {
|
|
|
18
32
|
tablerMinus = tablerMinus;
|
|
19
33
|
tablerPalette = tablerPalette;
|
|
20
34
|
static ɵfac = function SdThemeSelector_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SdThemeSelector)(); };
|
|
21
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SdThemeSelector, selectors: [["sd-theme-selector"]], decls:
|
|
35
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SdThemeSelector, selectors: [["sd-theme-selector"]], decls: 25, vars: 16, consts: [[3, "inline", "theme"], [3, "svg"], [1, "p-default"], [1, "flex-row", "gap-sm", "cross-align-center"], [1, "flex-row", "gap-xs", "cross-align-center"], [3, "click", "inline", "theme", "size", "disabled"], [3, "inline", "size", "theme"], [3, "valueChange", "inline", "value"], [3, "click", "inline", "size", "theme"]], template: function SdThemeSelector_Template(rf, ctx) { if (rf & 1) {
|
|
22
36
|
i0.ɵɵelementStart(0, "sd-dropdown")(1, "sd-button", 0);
|
|
23
37
|
i0.ɵɵelement(2, "ng-icon", 1);
|
|
24
38
|
i0.ɵɵelementEnd();
|
|
@@ -37,10 +51,16 @@ export class SdThemeSelector {
|
|
|
37
51
|
i0.ɵɵelement(14, "ng-icon", 1);
|
|
38
52
|
i0.ɵɵelementEnd()()();
|
|
39
53
|
i0.ɵɵelementStart(15, "div", 3)(16, "span");
|
|
40
|
-
i0.ɵɵtext(17, "\
|
|
54
|
+
i0.ɵɵtext(17, "\uD14C\uB9C8");
|
|
41
55
|
i0.ɵɵelementEnd();
|
|
42
|
-
i0.ɵɵelementStart(18, "
|
|
43
|
-
i0.ɵɵ
|
|
56
|
+
i0.ɵɵelementStart(18, "div", 4);
|
|
57
|
+
i0.ɵɵrepeaterCreate(19, SdThemeSelector_For_20_Template, 2, 4, "sd-button", 6, _forTrack0);
|
|
58
|
+
i0.ɵɵelementEnd()();
|
|
59
|
+
i0.ɵɵelementStart(21, "div", 3)(22, "span");
|
|
60
|
+
i0.ɵɵtext(23, "compact");
|
|
61
|
+
i0.ɵɵelementEnd();
|
|
62
|
+
i0.ɵɵelementStart(24, "sd-switch", 7);
|
|
63
|
+
i0.ɵɵlistener("valueChange", function SdThemeSelector_Template_sd_switch_valueChange_24_listener($event) { return ctx._sdTheme.density.set($event ? "compact" : "normal"); });
|
|
44
64
|
i0.ɵɵelementEnd()()()()();
|
|
45
65
|
} if (rf & 2) {
|
|
46
66
|
i0.ɵɵadvance();
|
|
@@ -57,8 +77,10 @@ export class SdThemeSelector {
|
|
|
57
77
|
i0.ɵɵproperty("inline", true)("theme", "link-gray")("size", "sm")("disabled", ctx.isMaxFontSize());
|
|
58
78
|
i0.ɵɵadvance();
|
|
59
79
|
i0.ɵɵproperty("svg", ctx.tablerPlus);
|
|
60
|
-
i0.ɵɵadvance(
|
|
61
|
-
i0.ɵɵ
|
|
80
|
+
i0.ɵɵadvance(5);
|
|
81
|
+
i0.ɵɵrepeater(ctx._sdTheme.themes);
|
|
82
|
+
i0.ɵɵadvance(5);
|
|
83
|
+
i0.ɵɵproperty("inline", true)("value", ctx._sdTheme.density() === "compact");
|
|
62
84
|
} }, dependencies: [SdDropdown, SdDropdownPopup, SdButton, SdSwitch, NgIcon], encapsulation: 2 });
|
|
63
85
|
}
|
|
64
86
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SdThemeSelector, [{
|
|
@@ -95,12 +117,31 @@ export class SdThemeSelector {
|
|
|
95
117
|
</div>
|
|
96
118
|
</div>
|
|
97
119
|
<div class="flex-row gap-sm cross-align-center">
|
|
98
|
-
<span
|
|
99
|
-
<
|
|
120
|
+
<span>테마</span>
|
|
121
|
+
<div class="flex-row gap-xs cross-align-center">
|
|
122
|
+
@for (item of _sdTheme.themes; track item.value) {
|
|
123
|
+
<sd-button
|
|
124
|
+
[inline]="true"
|
|
125
|
+
[size]="'sm'"
|
|
126
|
+
[theme]="_sdTheme.theme() === item.value ? 'primary' : 'link-gray'"
|
|
127
|
+
(click)="_sdTheme.theme.set(item.value)"
|
|
128
|
+
>
|
|
129
|
+
{{ item.label }}
|
|
130
|
+
</sd-button>
|
|
131
|
+
}
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="flex-row gap-sm cross-align-center">
|
|
135
|
+
<span>compact</span>
|
|
136
|
+
<sd-switch
|
|
137
|
+
[inline]="true"
|
|
138
|
+
[value]="_sdTheme.density() === 'compact'"
|
|
139
|
+
(valueChange)="_sdTheme.density.set($event ? 'compact' : 'normal')"
|
|
140
|
+
/>
|
|
100
141
|
</div>
|
|
101
142
|
</div>
|
|
102
143
|
</sd-dropdown-popup>
|
|
103
144
|
</sd-dropdown>
|
|
104
145
|
` }]
|
|
105
146
|
}], null, null); })();
|
|
106
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdThemeSelector, { className: "SdThemeSelector", filePath: "packages/angular/src/features/theme/sd-theme-selector.ts", lineNumber:
|
|
147
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdThemeSelector, { className: "SdThemeSelector", filePath: "packages/angular/src/features/theme/sd-theme-selector.ts", lineNumber: 82 }); })();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WCAG 2.x 대비율 (1-21).
|
|
3
|
+
*
|
|
4
|
+
* @param foregroundColor 전경색(텍스트 등). 알파면 배경 위에 합성 후 계산.
|
|
5
|
+
* @param backgroundColor 배경색. 알파면 `baseColor` 위에 합성(불투명 배경이면 불필요).
|
|
6
|
+
* @param baseColor 반투명 배경 아래의 최종 불투명 표면색.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getWcagContrastRatio(foregroundColor: string, backgroundColor: string, baseColor?: string): number;
|
|
9
|
+
//# sourceMappingURL=wcag-contrast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wcag-contrast.d.ts","sourceRoot":"","sources":["../../../src/features/theme/wcag-contrast.ts"],"names":[],"mappings":"AAuEA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAoBR"}
|