UNPKG

5.27 kBJavaScriptView Raw
1import { ShCard, ShCardHeader, ShCardBox, ShCardWidget, ShCardGroup, ShCardWithTabs } from './components/sh-card';
2import ShNotifications from './components/sh-notifications';
3import { ShButton, ShButtonGroup } from './components/sh-button';
4import ShButtonUpload from './components/sh-button-upload';
5import ShBannerTabs from './components/sh-banner-tabs';
6import { ShCheckbox, ShCheckboxGroup } from './components/sh-checkbox';
7import { ShRadio, ShRadioGroup } from './components/sh-radio';
8import { ShStatistics, ShStatisticsItem } from './components/sh-statistics';
9import ShInput from './components/sh-input';
10import ModalProgrammatic, { ShModal } from './components/sh-modal';
11import ShDialog from './components/sh-dialog';
12import ShImage from './components/sh-image';
13import { ShTable, ShTableColumn } from './components/sh-table';
14import { ShTableCellActions } from './components/sh-table-cell';
15import { ShTag, ShTagButton, ShTagCreator, ShTagIcon } from './components/sh-tag';
16import { ShField, ShFieldGroup } from './components/sh-field';
17import ShIcon from './components/sh-icon';
18import ShTextarea from './components/sh-textarea';
19import ShSwitch from './components/sh-switch';
20import ShPageHeader from './components/sh-page-header';
21import ShDragableTags from './components/sh-dragable-tags';
22import { ShDropdown, ShDropdownItem } from './components/sh-dropdown';
23import ShNotificationBanner from './components/sh-notification-banner';
24import ShBlankslate from './components/sh-blankslate';
25import ShActionBarLayout from './components/sh-action-bar-layout';
26import ShActionPage from './components/sh-action-page';
27import ShLoading from './components/sh-loading';
28import ShPhotosGrid from './components/sh-photos-grid';
29import {ShHistory, ShComment, ShCustomerData} from './components/sh-history';
30import ShSingleColumnLayout from './layouts/single-column';
31import ShTwoColumnsLayout from './layouts/two-columns';
32import ShReadMore from './directives/sh-read-more/sh-read-more';
33import ShRedactor from './components/sh-redactor';
34import ShChannelTabs from './components/sh-channel-tabs';
35import { ShAddress, ShData } from './components/sh-address';
36import ShImageSelector from './components/sh-image-selector';
37import ShUploadField from './components/sh-upload-field';
38import ShLabel from './components/sh-label';
39import ShProductCard from './components/sh-product-card';
40import ShAutocompleter from './components/sh-autocompleter';
41import ShPaginationList from './components/sh-pagination-list';
42import ShCategoriesSelect from './components/sh-categories-select';
43import ShProductPrice from './components/sh-product-price';
44import ShColorpicker from './components/sh-colorpicker';
45
46
47const components = {
48 ShData,
49 ShAddress,
50 ShDragableTags,
51 ShHistory,
52 ShComment,
53 ShCustomerData,
54 ShCard,
55 ShCardBox,
56 ShCardHeader,
57 ShCardWidget,
58 ShCardGroup,
59 ShCardWithTabs,
60 ShButton,
61 ShButtonGroup,
62 ShButtonUpload,
63 ShUploadField,
64 ShTwoColumnsLayout,
65 ShSingleColumnLayout,
66 ShNotifications,
67 ShCheckbox,
68 ShCheckboxGroup,
69 ShRadio,
70 ShRadioGroup,
71 ShInput,
72 ShModal,
73 ShTable,
74 ShTableColumn,
75 ShTableCellActions,
76 ShTag,
77 ShTagIcon,
78 ShTagCreator,
79 ShField,
80 ShFieldGroup,
81 ShTagButton,
82 ShIcon,
83 ShSwitch,
84 ShImage,
85 ShTextarea,
86 ShDropdown,
87 ShDropdownItem,
88 ShPageHeader,
89 ShNotificationBanner,
90 ShBlankslate,
91 ShActionBarLayout,
92 ShActionPage,
93 ShPhotosGrid,
94 ShStatistics,
95 ShStatisticsItem,
96 ShBannerTabs,
97 ShRedactor,
98 ShChannelTabs,
99 ShImageSelector,
100 ShLabel,
101 ShProductCard,
102 ShAutocompleter,
103 ShPaginationList,
104 ShCategoriesSelect,
105 ShProductPrice,
106 ShColorpicker,
107};
108
109const directives = {
110 'read-more': ShReadMore
111};
112
113
114import en from './locale/en_US.json';
115import pl from './locale/pl_PL.json';
116
117export default function install(Vue, opts = {}) {
118 if (opts.i18n) {
119 opts.i18n.mergeLocaleMessage('en', en);
120 opts.i18n.mergeLocaleMessage('pl', pl);
121 }
122 Object.keys(components).forEach((name) =>{
123 // @ts-ignore
124 Vue.component(name, components[name]);
125 });
126 Object.keys(directives).forEach((name) => {
127 Vue.directive(name, directives[name])
128 });
129
130 Vue.use(ShLoading.loading);
131 Vue.prototype.$shdialog = ShDialog;
132 Vue.prototype.$shmodal = ModalProgrammatic;
133}
134export {
135 ShDialog,
136 ModalProgrammatic,
137 ShData,
138 ShAddress,
139 ShDragableTags,
140 ShCard,
141 ShCardBox,
142 ShHistory,
143 ShComment,
144 ShCustomerData,
145 ShCardHeader,
146 ShCardWidget,
147 ShCardGroup,
148 ShCardWithTabs,
149 ShButton,
150 ShButtonGroup,
151 ShButtonUpload,
152 ShUploadField,
153 ShTwoColumnsLayout,
154 ShSingleColumnLayout,
155 ShNotifications,
156 ShCheckbox,
157 ShCheckboxGroup,
158 ShRadio,
159 ShRadioGroup,
160 ShInput,
161 ShModal,
162 ShTable,
163 ShTableColumn,
164 ShTableCellActions,
165 ShTag,
166 ShTagIcon,
167 ShTagCreator,
168 ShField,
169 ShFieldGroup,
170 ShTagButton,
171 ShIcon,
172 ShSwitch,
173 ShImage,
174 ShTextarea,
175 ShDropdown,
176 ShDropdownItem,
177 ShPageHeader,
178 ShNotificationBanner,
179 ShBlankslate,
180 ShActionBarLayout,
181 ShActionPage,
182 ShPhotosGrid,
183 ShStatistics,
184 ShStatisticsItem,
185 ShBannerTabs,
186 ShRedactor,
187 ShChannelTabs,
188 ShImageSelector,
189 ShLabel,
190 ShProductCard,
191 ShAutocompleter,
192 ShPaginationList,
193 ShCategoriesSelect,
194 ShProductPrice,
195 ShColorpicker,
196}
197
198// export default components;