@pixel-shell/elpis 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/.eslintgnore +1 -0
  2. package/.eslintrc +55 -0
  3. package/README.md +194 -0
  4. package/app/controller/base.js +40 -0
  5. package/app/controller/project.js +56 -0
  6. package/app/controller/view.js +18 -0
  7. package/app/extend/logger.js +37 -0
  8. package/app/middleware/api-params-verify.js +71 -0
  9. package/app/middleware/api-sign-verify.js +32 -0
  10. package/app/middleware/error-handler.js +33 -0
  11. package/app/middleware/project-handler.js +27 -0
  12. package/app/middleware.js +31 -0
  13. package/app/pages/asserts/custom.css +12 -0
  14. package/app/pages/boot.js +47 -0
  15. package/app/pages/common/curl.js +88 -0
  16. package/app/pages/common/utils.js +2 -0
  17. package/app/pages/dashboard/complex-view/header-view/complex-view/sub-menu/sub-menu.vue +17 -0
  18. package/app/pages/dashboard/complex-view/header-view/header-view.vue +129 -0
  19. package/app/pages/dashboard/complex-view/iframe-view/iframe-view.vue +43 -0
  20. package/app/pages/dashboard/complex-view/schema-view/complex-view/search-panel/search-panel.vue +37 -0
  21. package/app/pages/dashboard/complex-view/schema-view/complex-view/table-panel/table-panel.vue +114 -0
  22. package/app/pages/dashboard/complex-view/schema-view/components/component-config.js +22 -0
  23. package/app/pages/dashboard/complex-view/schema-view/components/create-form/create-form.vue +85 -0
  24. package/app/pages/dashboard/complex-view/schema-view/components/detail-panel/detail-panel.vue +92 -0
  25. package/app/pages/dashboard/complex-view/schema-view/components/edit-form/edit-form.vue +106 -0
  26. package/app/pages/dashboard/complex-view/schema-view/hook/schema.js +123 -0
  27. package/app/pages/dashboard/complex-view/schema-view/schema-view.vue +88 -0
  28. package/app/pages/dashboard/complex-view/sider-view/complex-view/sub-menu/sub-menu.vue +18 -0
  29. package/app/pages/dashboard/complex-view/sider-view/sider-view.vue +117 -0
  30. package/app/pages/dashboard/dashboard.vue +89 -0
  31. package/app/pages/dashboard/entry.dashboard.js +42 -0
  32. package/app/pages/store/index.js +5 -0
  33. package/app/pages/store/menu.js +57 -0
  34. package/app/pages/store/project.js +15 -0
  35. package/app/pages/widgets/header-container/asserts/avatar.png +0 -0
  36. package/app/pages/widgets/header-container/asserts/logo.png +0 -0
  37. package/app/pages/widgets/header-container/header-container.vue +102 -0
  38. package/app/pages/widgets/schema-form/complex-view/input/input.vue +129 -0
  39. package/app/pages/widgets/schema-form/complex-view/input-number/input-number.vue +130 -0
  40. package/app/pages/widgets/schema-form/complex-view/select/select.vue +116 -0
  41. package/app/pages/widgets/schema-form/form-item-config.js +23 -0
  42. package/app/pages/widgets/schema-form/schema-form.vue +121 -0
  43. package/app/pages/widgets/schema-search-bar/complex-view/date-range/date-range.vue +41 -0
  44. package/app/pages/widgets/schema-search-bar/complex-view/dynamic-select/dynamic-select.vue +51 -0
  45. package/app/pages/widgets/schema-search-bar/complex-view/input/input.vue +34 -0
  46. package/app/pages/widgets/schema-search-bar/complex-view/select/select.vue +36 -0
  47. package/app/pages/widgets/schema-search-bar/schema-search-bar.vue +121 -0
  48. package/app/pages/widgets/schema-search-bar/search-item-config.js +27 -0
  49. package/app/pages/widgets/schema-table/schema-table.vue +227 -0
  50. package/app/pages/widgets/sider-container/sider-container.vue +29 -0
  51. package/app/public/static/logo.png +0 -0
  52. package/app/public/static/normalize.css +241 -0
  53. package/app/router/project.js +6 -0
  54. package/app/router/view.js +8 -0
  55. package/app/router-schema/project.js +30 -0
  56. package/app/service/base.js +10 -0
  57. package/app/service/project.js +40 -0
  58. package/app/view/entry.tpl +25 -0
  59. package/app/webpack/build.js +18 -0
  60. package/app/webpack/config/webpack.base.js +234 -0
  61. package/app/webpack/config/webpack.dev.js +58 -0
  62. package/app/webpack/config/webpack.prod.js +113 -0
  63. package/app/webpack/dev.js +60 -0
  64. package/app/webpack/libs/blank.js +1 -0
  65. package/app/webpack/prod.js +22 -0
  66. package/config/config.default.js +3 -0
  67. package/docs/dashboard-mode.js +141 -0
  68. package/elpis-core/env.js +16 -0
  69. package/elpis-core/index.js +70 -0
  70. package/elpis-core/loader/config.js +51 -0
  71. package/elpis-core/loader/controller.js +71 -0
  72. package/elpis-core/loader/extend.js +61 -0
  73. package/elpis-core/loader/middleware.js +69 -0
  74. package/elpis-core/loader/roter-schema.js +54 -0
  75. package/elpis-core/loader/router.js +42 -0
  76. package/elpis-core/loader/service.js +70 -0
  77. package/index.js +35 -0
  78. package/model/index.js +86 -0
  79. package/package.json +92 -0
  80. package/test/controller/project.test.js +194 -0
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <el-input
3
+ v-model="dtoValue"
4
+ v-bind="schema.option"
5
+ placeholder="请输入"
6
+ class="input"
7
+ ></el-input>
8
+ </template>
9
+ <script setup>
10
+ import { ref, onMounted } from "vue";
11
+
12
+ const { schemaKey, schema } = defineProps({
13
+ schemaKey: String,
14
+ schema: Object,
15
+ });
16
+
17
+ const emit = defineEmits(["loaded"]);
18
+ const dtoValue = ref();
19
+ const getValue = () => {
20
+ return dtoValue.value !== undefined ? { [schemaKey]: dtoValue.value } : {};
21
+ };
22
+ const reset = () => {
23
+ dtoValue.value = schema?.option?.default || "";
24
+ };
25
+ onMounted(() => {
26
+ reset();
27
+ emit("loaded");
28
+ })
29
+ defineExpose({
30
+ getValue,
31
+ reset,
32
+ });
33
+ </script>
34
+ <style lang="scss" scoped></style>
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <el-select v-model="dtoValue" v-bind="schema.option" class="select">
3
+ <el-option
4
+ v-for="item in schema.option?.enumList"
5
+ :key="item.value"
6
+ :label="item.label"
7
+ :value="item.value"
8
+ ></el-option
9
+ ></el-select>
10
+ </template>
11
+ <script setup>
12
+ import { ref, onMounted } from "vue";
13
+
14
+ const { schemaKey, schema } = defineProps({
15
+ schemaKey: String,
16
+ schema: Object,
17
+ });
18
+
19
+ const emit = defineEmits(["loaded"]);
20
+ const dtoValue = ref();
21
+ const getValue = () => {
22
+ return dtoValue.value !== undefined ? { [schemaKey]: dtoValue.value } : {};
23
+ };
24
+ const reset = () => {
25
+ dtoValue.value = schema?.option?.default ?? schema.option?.enumList[0]?.value;
26
+ };
27
+ onMounted(() => {
28
+ reset();
29
+ emit("loaded");
30
+ })
31
+ defineExpose({
32
+ getValue,
33
+ reset,
34
+ });
35
+ </script>
36
+ <style lang="scss" scoped></style>
@@ -0,0 +1,121 @@
1
+ <template>
2
+ <el-form
3
+ v-if="schema && schema.properties"
4
+ :inline="true"
5
+ class="schema-search-bar"
6
+ >
7
+ <!-- 动态组件 -->
8
+ <el-form-item
9
+ v-for="(schemaItem, key) in schema.properties"
10
+ :key="key"
11
+ :label="schemaItem.label"
12
+ >
13
+ <component
14
+ ref="searchComList"
15
+ :is="SearchItemConfig[schemaItem.option?.comType]?.component"
16
+ :schemaKey="key"
17
+ :schema="schemaItem"
18
+ @loaded="handleChileLoaded"
19
+ ></component>
20
+ </el-form-item>
21
+ <!-- 操作区域 -->
22
+ <el-form-item>
23
+ <el-button type="primary" plain @click="search" class="search-btn"
24
+ >搜索</el-button
25
+ >
26
+ <el-button type="primary" plain @click="reset" class="reset-btn"
27
+ >重置</el-button
28
+ >
29
+ </el-form-item>
30
+ </el-form>
31
+ </template>
32
+
33
+ <script setup>
34
+ import { ref, toRefs } from "vue";
35
+ import SearchItemConfig from "./search-item-config.js";
36
+ const props = defineProps({
37
+ /**
38
+ * schema 配置 结构如下
39
+ * {
40
+ type: "object",
41
+ properties: {
42
+ key: {
43
+ ...schema, // 标准schema配置
44
+ type: "", // 字段类型
45
+ label: "", // 字段中文名
46
+ // 字段在search-bar中的相关配置
47
+ option: {
48
+ ...elComponentConfig, //标准 el-component-column 配置
49
+ comType: "", // 配置组件类型 ,枚举值:input,select 。。。
50
+ defaule: "" // 默认值
51
+ },
52
+ },
53
+ },
54
+ }
55
+ */
56
+ schema: Object,
57
+ });
58
+ const { schema } = toRefs(props);
59
+ const emit = defineEmits(["load", "search", "reset"]);
60
+
61
+ const searchComList = ref([]);
62
+
63
+ const getValue = () => {
64
+ let dtoObj = {};
65
+ searchComList.value.forEach((component) => {
66
+ dtoObj = {
67
+ ...dtoObj,
68
+ ...component?.getValue(),
69
+ }
70
+ });
71
+ return dtoObj;
72
+ };
73
+
74
+ let childComLoadedCount = 0;
75
+ const handleChileLoaded = (schemaKey, value) => {
76
+ childComLoadedCount++;
77
+ if (childComLoadedCount >= Object.keys(schema?.value?.properties).length) {
78
+ emit("load", getValue());
79
+ }
80
+ };
81
+ const search = () => {
82
+ console.log(22222, getValue());
83
+ emit("search", getValue());
84
+ };
85
+ const reset = () => {
86
+ searchComList.value.forEach((component) => {
87
+ component?.reset();
88
+ });
89
+ emit("reset");
90
+ };
91
+ defineExpose({
92
+ reset,
93
+ getValue
94
+ });
95
+ </script>
96
+
97
+ <style lang="less">
98
+ .schema-search-bar {
99
+ min-width: 500px;
100
+
101
+ .input {
102
+ width: 280px;
103
+ }
104
+
105
+ .select {
106
+ width: 230px;
107
+ }
108
+
109
+ .dynamic-select {
110
+ width: 230px;
111
+ }
112
+
113
+ .search-btn {
114
+ width: 100px;
115
+ }
116
+
117
+ .reset-btn {
118
+ width: 100px;
119
+ }
120
+ }
121
+ </style>
@@ -0,0 +1,27 @@
1
+ import input from "./complex-view/input/input.vue";
2
+ import select from "./complex-view/select/select.vue";
3
+ import dynamicSelect from "./complex-view/dynamic-select/dynamic-select.vue";
4
+ import dateRange from "./complex-view/date-range/date-range.vue";
5
+
6
+ // 业务扩展 search-item 配置
7
+ import BusinessSearchItemConfig from "$businessSearchItemConfig"
8
+
9
+ const SearchItemConfig = {
10
+ input: {
11
+ component: input
12
+ },
13
+ select: {
14
+ component: select
15
+ },
16
+ dynamicSelect: {
17
+ component: dynamicSelect
18
+ },
19
+ dateRange: {
20
+ component: dateRange
21
+ }
22
+ }
23
+
24
+ export default {
25
+ ...SearchItemConfig,
26
+ ...BusinessSearchItemConfig
27
+ };
@@ -0,0 +1,227 @@
1
+ <template>
2
+ <div class="schema-table">
3
+ <el-table
4
+ v-if="schema && schema.properties"
5
+ v-loading="loading"
6
+ :data="tableData"
7
+ class="table"
8
+ :header-cell-style="{backgroundColor: '#000'}"
9
+ >
10
+ <template v-for="(schemaItem, key) in schema.properties">
11
+ <el-table-column
12
+ v-if="schemaItem.option.visible !== false"
13
+ :key="key"
14
+ :prop="key"
15
+ :label="schemaItem.label"
16
+ v-bind="schemaItem.option"
17
+ ></el-table-column>
18
+ </template>
19
+ <el-table-column
20
+ v-if="buttons?.length > 0"
21
+ label="操作"
22
+ fixed="right"
23
+ :width="operationWidth"
24
+ >
25
+ <template #default="scoped">
26
+ <el-button
27
+ v-for="item in buttons"
28
+ link
29
+ v-bind="item"
30
+ @click="operationHandle({ btnConfig: item, rowData: scoped.row })"
31
+ >{{ item.label }}</el-button
32
+ >
33
+ </template>
34
+ </el-table-column>
35
+ </el-table>
36
+ <el-row justify="end" class="pagination">
37
+ <el-pagination
38
+ :current-page="currentPage"
39
+ :page-size="pageSize"
40
+ :page-sizes="[10, 20, 50, 100]"
41
+ :total="total"
42
+ layout="total, sizes, prev, pager, next, jumper"
43
+ @size-change="onPageSizeChange"
44
+ @current-change="onCurrentPageChange"
45
+ >
46
+ </el-pagination>
47
+ </el-row>
48
+ </div>
49
+ </template>
50
+
51
+ <script setup>
52
+ import { ref, toRefs, computed, watch, nextTick, onMounted } from "vue";
53
+ import $curl from "$elpisCommon/curl.js";
54
+
55
+ const emit = defineEmits(["operate"]);
56
+
57
+ const props = defineProps({
58
+ /**
59
+ * schema 配置 结构如下:
60
+ * {
61
+ * type: "object",
62
+ properties: {
63
+ key: {
64
+ ...schema, // 标准schema配置
65
+ type: "", // 字段类型
66
+ label: "", // 字段中文名
67
+ // 字段在table中的相关配置
68
+ tableOption: {
69
+ ...elTableColumnConfig, //标准 el-table-column 配置
70
+ visible: true, // 是否在table中显示
71
+ }
72
+ },
73
+ },
74
+ * }
75
+ */
76
+ schema: Object,
77
+ /**
78
+ * 表格数据源api
79
+ */
80
+ api: String,
81
+ /**
82
+ * api请求参数, 请求API时携带
83
+ */
84
+ apiParams: Object,
85
+ /**
86
+ * 按钮配置 结构如下:
87
+ * {
88
+ label: "", // 按钮中文名
89
+ eventKey: "", // 按钮事件名
90
+ eventOption: {}, // 按钮事件具体配置
91
+ ...elButtonConfig, // 标准 el-button 配置
92
+ * }
93
+ */
94
+ buttons: Array,
95
+ });
96
+ const { schema, api, buttons, apiParams } = toRefs(props);
97
+ const operationWidth = computed(() => {
98
+ return buttons?.value?.length > 0
99
+ ? buttons.value.reduce((pre, cur) => {
100
+ return pre + cur.label.length * 18;
101
+ }, 50)
102
+ : 50;
103
+ });
104
+ const loading = ref(false);
105
+ const tableData = ref([]);
106
+ const currentPage = ref(1);
107
+ const pageSize = ref(50);
108
+ const total = ref(0);
109
+
110
+ onMounted(() => {
111
+ initData();
112
+ });
113
+
114
+ const initData = () => {
115
+ currentPage.value = 1;
116
+ pageSize.value = 50;
117
+ nextTick(async () => {
118
+ await loadTableData();
119
+ });
120
+ };
121
+
122
+ let timerId = null;
123
+ const loadTableData = async () => {
124
+ clearTimeout(timerId);
125
+ timerId = setTimeout(async () => {
126
+ await fetchTableData();
127
+ timerId = null;
128
+ }, 100);
129
+ };
130
+ const fetchTableData = async () => {
131
+ if (!api.value) return;
132
+ if (loading.value) return;
133
+ showLoading();
134
+ // 请求table数据
135
+ const res = await $curl({
136
+ method: "GET",
137
+ url: `${api.value}/list`,
138
+ query: {
139
+ ...apiParams.value,
140
+ page: currentPage.value,
141
+ size: pageSize.value,
142
+ },
143
+ });
144
+ hideLoading();
145
+ if (!res || !res.success || !Array.isArray(res.data)) {
146
+ tableData.value = [];
147
+ total.value = 0;
148
+ return;
149
+ }
150
+ tableData.value = buildTableData(res.data);
151
+ total.value = res.metadata.total;
152
+ };
153
+
154
+ /**
155
+ * 对后端返回的数据进行渲染前的预处理
156
+ * @param data 后端返回的数据
157
+ */
158
+ const buildTableData = (data) => {
159
+ if (!schema.value?.properties) return data;
160
+ return data.map((dataItem) => {
161
+ for (const dKey in dataItem) {
162
+ const schemaItem = schema.value.properties[dKey];
163
+ if (schemaItem?.option?.toFixed) {
164
+ dataItem[dKey] = Number(dataItem[dKey]).toFixed(
165
+ schemaItem.option.toFixed,
166
+ );
167
+ }
168
+ }
169
+ return dataItem;
170
+ });
171
+ };
172
+
173
+ const showLoading = () => {
174
+ loading.value = true;
175
+ };
176
+
177
+ const hideLoading = () => {
178
+ loading.value = false;
179
+ };
180
+
181
+ const operationHandle = ({ btnConfig, rowData }) => {
182
+ emit("operate", { btnConfig, rowData });
183
+ };
184
+
185
+ const onPageSizeChange = async (size) => {
186
+ pageSize.value = size;
187
+ await loadTableData();
188
+ };
189
+
190
+ const onCurrentPageChange = async (page) => {
191
+ currentPage.value = page;
192
+ await loadTableData();
193
+ };
194
+
195
+ watch(
196
+ [schema, api, apiParams],
197
+ () => {
198
+ initData();
199
+ },
200
+ { deep: true },
201
+ );
202
+
203
+ defineExpose({
204
+ initData,
205
+ loadTableData,
206
+ showLoading,
207
+ hideLoading,
208
+ });
209
+ </script>
210
+
211
+ <style lang="less" scoped>
212
+ .schema-table {
213
+ flex: 1;
214
+ display: flex;
215
+ flex-direction: column;
216
+ overflow: auto;
217
+
218
+ .table {
219
+ flex: 1;
220
+ }
221
+
222
+ .pagination {
223
+ margin: 10px 0;
224
+ text-align: right;
225
+ }
226
+ }
227
+ </style>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <el-container class="sider-container">
3
+ <el-aside width="200px" class="aside">
4
+ <slot name="sider-content"></slot>
5
+ </el-aside>
6
+ <el-main class="main">
7
+ <slot name="main-content"></slot>
8
+ </el-main>
9
+ </el-container>
10
+ </template>
11
+
12
+ <script setup></script>
13
+
14
+ <style lang="less" scoped>
15
+ .sider-container {
16
+ height: 100%;
17
+
18
+ .aside {
19
+ border-right: 1px solid #e8e8e8;
20
+ }
21
+ .main {
22
+ overflow: scroll;
23
+ }
24
+ }
25
+
26
+ :deep(.el-menu) {
27
+ border-right: 0;
28
+ }
29
+ </style>
Binary file
@@ -0,0 +1,241 @@
1
+ /*! normalize.css v3.0.2 | MIT License | git.io/normalize */
2
+
3
+ /**
4
+ * 1. Set default font family to sans-serif.
5
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
6
+ * user zoom.
7
+ */
8
+ html,body,span,div,p,a,table,tbody,td,h1,h2,h3,img,form,font,strong,b,i,dl,dt,dd,ol,ul,li,dl,dd,dt,iframe,label,blockquote,input,button
9
+ {
10
+ padding: 0;
11
+ margin: 0;
12
+ list-style: none;
13
+ }
14
+
15
+ html {
16
+ font-family: "Open Sans","Helvetica Neue","Microsoft Yahei",sans-serif;/* 1 */
17
+ -ms-text-size-adjust: 100%; /* 2 */
18
+ -webkit-text-size-adjust: 100%; /* 2 */
19
+ }
20
+
21
+ /**
22
+ * Remove default margin.
23
+ */
24
+
25
+ body {
26
+ margin: 0;
27
+ }
28
+
29
+ /* Links
30
+ ========================================================================== */
31
+
32
+ /**
33
+ * Remove the gray background color from active links in IE 10.
34
+ */
35
+
36
+ a {
37
+ background-color: transparent;
38
+ text-decoration: none;
39
+ }
40
+
41
+ /**
42
+ * Improve readability when focused and also mouse hovered in all browsers.
43
+ */
44
+
45
+ a:active,
46
+ a:hover {
47
+ outline: 0;
48
+ }
49
+
50
+ /* Text-level semantics
51
+ ========================================================================== */
52
+
53
+ /**
54
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
55
+ */
56
+
57
+ b,
58
+ strong {
59
+ font-weight: bold;
60
+ }
61
+
62
+ /* Embedded content
63
+ ========================================================================== */
64
+
65
+ /**
66
+ * Remove border when inside `a` element in IE 8/9/10.
67
+ */
68
+
69
+ img {
70
+ border: 0;
71
+ }
72
+
73
+
74
+ /* Grouping content
75
+ ========================================================================== */
76
+
77
+ /**
78
+ * Address margin not present in IE 8/9 and Safari.
79
+ */
80
+
81
+ figure {
82
+ margin: 1em 40px;
83
+ }
84
+
85
+
86
+ /* Forms
87
+ ========================================================================== */
88
+
89
+ /**
90
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
91
+ * styling of `select`, unless a `border` property is set.
92
+ */
93
+
94
+ /**
95
+ * 1. Correct color not being inherited.
96
+ * Known issue: affects color of disabled elements.
97
+ * 2. Correct font properties not being inherited.
98
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
99
+ */
100
+
101
+ button,
102
+ input,
103
+ optgroup,
104
+ select,
105
+ textarea {
106
+ color: inherit; /* 1 */
107
+ font: inherit; /* 2 */
108
+ margin: 0; /* 3 */
109
+ }
110
+
111
+ /**
112
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
113
+ */
114
+
115
+ button {
116
+ overflow: visible;
117
+ }
118
+
119
+ /**
120
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
121
+ * All other form control elements do not inherit `text-transform` values.
122
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
123
+ * Correct `select` style inheritance in Firefox.
124
+ */
125
+
126
+ button,
127
+ select {
128
+ text-transform: none;
129
+ }
130
+
131
+ /**
132
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
133
+ * and `video` controls.
134
+ * 2. Correct inability to style clickable `input` types in iOS.
135
+ * 3. Improve usability and consistency of cursor style between image-type
136
+ * `input` and others.
137
+ */
138
+
139
+ button,
140
+ html input[type="button"], /* 1 */
141
+ input[type="reset"],
142
+ input[type="submit"] {
143
+ -webkit-appearance: button; /* 2 */
144
+ appearance: button;
145
+ cursor: pointer; /* 3 */
146
+ }
147
+
148
+ /**
149
+ * Re-set default cursor for disabled elements.
150
+ */
151
+
152
+ button[disabled],
153
+ html input[disabled] {
154
+ cursor: default;
155
+ }
156
+
157
+ /**
158
+ * Remove inner padding and border in Firefox 4+.
159
+ */
160
+
161
+ button::-moz-focus-inner,
162
+ input::-moz-focus-inner {
163
+ border: 0;
164
+ padding: 0;
165
+ }
166
+
167
+ /**
168
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
169
+ * the UA stylesheet.
170
+ */
171
+
172
+ input {
173
+ line-height: normal;
174
+ }
175
+
176
+ /**
177
+ * It's recommended that you don't attempt to style these elements.
178
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
179
+ *
180
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
181
+ * 2. Remove excess padding in IE 8/9/10.
182
+ */
183
+
184
+ input[type="checkbox"],
185
+ input[type="radio"] {
186
+ box-sizing: border-box; /* 1 */
187
+ padding: 0; /* 2 */
188
+ }
189
+
190
+ /**
191
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
192
+ * `font-size` values of the `input`, it causes the cursor style of the
193
+ * decrement button to change from `default` to `text`.
194
+ */
195
+
196
+ input[type="number"]::-webkit-inner-spin-button,
197
+ input[type="number"]::-webkit-outer-spin-button {
198
+ height: auto;
199
+ }
200
+
201
+ /**
202
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
203
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome
204
+ * (include `-moz` to future-proof).
205
+ */
206
+
207
+ input[type="search"] {
208
+ -webkit-appearance: textfield; /* 1 */
209
+ appearance: textfield;
210
+ -moz-box-sizing: content-box;
211
+ -webkit-box-sizing: content-box; /* 2 */
212
+ box-sizing: content-box;
213
+ }
214
+
215
+ /**
216
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
217
+ * Safari (but not Chrome) clips the cancel button when the search input has
218
+ * padding (and `textfield` appearance).
219
+ */
220
+
221
+ input[type="search"]::-webkit-search-cancel-button,
222
+ input[type="search"]::-webkit-search-decoration {
223
+ -webkit-appearance: none;
224
+ }
225
+
226
+ /* Tables
227
+ ========================================================================== */
228
+
229
+ /**
230
+ * Remove most spacing between table cells.
231
+ */
232
+
233
+ table {
234
+ border-collapse: collapse;
235
+ border-spacing: 0;
236
+ }
237
+
238
+ td,
239
+ th {
240
+ padding: 0;
241
+ }