@tmagic/utils 1.5.0-beta.4 → 1.5.0-beta.5
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/tmagic-utils.js +1 -21
- package/dist/tmagic-utils.umd.cjs +4 -23
- package/package.json +2 -7
- package/src/index.ts +0 -27
- package/types/index.d.ts +1 -2
- package/src/resetcss.css +0 -446
package/dist/tmagic-utils.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import utc from 'dayjs/plugin/utc';
|
|
3
1
|
import { set, cloneDeep } from 'lodash-es';
|
|
4
2
|
import { NodeType } from '@tmagic/schema';
|
|
5
3
|
|
|
@@ -123,24 +121,6 @@ const sleep = (ms) => new Promise((resolve) => {
|
|
|
123
121
|
resolve();
|
|
124
122
|
}, ms);
|
|
125
123
|
});
|
|
126
|
-
const datetimeFormatter = (v, defaultValue = "-", format = "YYYY-MM-DD HH:mm:ss") => {
|
|
127
|
-
if (v) {
|
|
128
|
-
let time;
|
|
129
|
-
if (["x", "timestamp"].includes(format)) {
|
|
130
|
-
time = dayjs(v).valueOf();
|
|
131
|
-
} else if (typeof v === "string" && v.includes("Z") || v.constructor === Date) {
|
|
132
|
-
dayjs.extend(utc);
|
|
133
|
-
time = dayjs(v).utcOffset(8).format(format);
|
|
134
|
-
} else {
|
|
135
|
-
time = dayjs(v).format(format);
|
|
136
|
-
}
|
|
137
|
-
if (time !== "Invalid Date") {
|
|
138
|
-
return time;
|
|
139
|
-
}
|
|
140
|
-
return defaultValue;
|
|
141
|
-
}
|
|
142
|
-
return defaultValue;
|
|
143
|
-
};
|
|
144
124
|
const toLine = (name = "") => name.replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
145
125
|
const toHump = (name = "") => name.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
|
|
146
126
|
const emptyFn = () => void 0;
|
|
@@ -420,4 +400,4 @@ const addParamToUrl = (obj, global = globalThis, needReload = true) => {
|
|
|
420
400
|
const dataSourceTemplateRegExp = /\$\{([\s\S]+?)\}/g;
|
|
421
401
|
const isDslNode = (config) => typeof config[IS_DSL_NODE_KEY] === "undefined" || config[IS_DSL_NODE_KEY] === true;
|
|
422
402
|
|
|
423
|
-
export { DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, DSL_NODE_KEY_COPY_PREFIX, IS_DSL_NODE_KEY, addClassName, addParamToUrl, asyncLoadCss, asyncLoadJs, calcValueByFontsize, calculatePercentage, compiledCond, compiledNode, convertToNumber, createDiv, dataSourceTemplateRegExp,
|
|
403
|
+
export { DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, DSL_NODE_KEY_COPY_PREFIX, IS_DSL_NODE_KEY, addClassName, addParamToUrl, asyncLoadCss, asyncLoadJs, calcValueByFontsize, calculatePercentage, compiledCond, compiledNode, convertToNumber, createDiv, dataSourceTemplateRegExp, emptyFn, filterXSS, getDefaultValueFromFields, getDepKeys, getDepNodeIds, getDocument, getElById, getHost, getIdFromEl, getKeys, getKeysArray, getNodePath, getNodes, getUrlParam, getValueByKeyPath, guid, injectStyle, isDslNode, isNumber, isObject, isPage, isPageFragment, isPercentage, isPop, isSameDomain, removeClassName, removeClassNameByClassName, replaceChildNode, setDslDomRelateConfig, setIdToEl, setValueByKeyPath, sleep, toHump, toLine };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicUtils = {}, global.
|
|
5
|
-
})(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tmagic/schema')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tmagic/schema'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicUtils = {}, global.schema));
|
|
5
|
+
})(this, (function (exports, schema) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/** Detect free variable `global` from Node.js. */
|
|
8
8
|
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
@@ -2730,24 +2730,6 @@
|
|
|
2730
2730
|
resolve();
|
|
2731
2731
|
}, ms);
|
|
2732
2732
|
});
|
|
2733
|
-
const datetimeFormatter = (v, defaultValue = "-", format = "YYYY-MM-DD HH:mm:ss") => {
|
|
2734
|
-
if (v) {
|
|
2735
|
-
let time;
|
|
2736
|
-
if (["x", "timestamp"].includes(format)) {
|
|
2737
|
-
time = dayjs(v).valueOf();
|
|
2738
|
-
} else if (typeof v === "string" && v.includes("Z") || v.constructor === Date) {
|
|
2739
|
-
dayjs.extend(utc);
|
|
2740
|
-
time = dayjs(v).utcOffset(8).format(format);
|
|
2741
|
-
} else {
|
|
2742
|
-
time = dayjs(v).format(format);
|
|
2743
|
-
}
|
|
2744
|
-
if (time !== "Invalid Date") {
|
|
2745
|
-
return time;
|
|
2746
|
-
}
|
|
2747
|
-
return defaultValue;
|
|
2748
|
-
}
|
|
2749
|
-
return defaultValue;
|
|
2750
|
-
};
|
|
2751
2733
|
const toLine = (name = "") => name.replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
2752
2734
|
const toHump = (name = "") => name.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
|
|
2753
2735
|
const emptyFn = () => void 0;
|
|
@@ -3042,7 +3024,6 @@
|
|
|
3042
3024
|
exports.convertToNumber = convertToNumber;
|
|
3043
3025
|
exports.createDiv = createDiv;
|
|
3044
3026
|
exports.dataSourceTemplateRegExp = dataSourceTemplateRegExp;
|
|
3045
|
-
exports.datetimeFormatter = datetimeFormatter;
|
|
3046
3027
|
exports.emptyFn = emptyFn;
|
|
3047
3028
|
exports.filterXSS = filterXSS;
|
|
3048
3029
|
exports.getDefaultValueFromFields = getDefaultValueFromFields;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.0-beta.
|
|
2
|
+
"version": "1.5.0-beta.5",
|
|
3
3
|
"name": "@tmagic/utils",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/tmagic-utils.umd.cjs",
|
|
@@ -10,10 +10,6 @@
|
|
|
10
10
|
"types": "./types/index.d.ts",
|
|
11
11
|
"import": "./dist/tmagic-utils.js",
|
|
12
12
|
"require": "./dist/tmagic-utils.umd.cjs"
|
|
13
|
-
},
|
|
14
|
-
"./resetcss.css": {
|
|
15
|
-
"import": "./src/resetcss.css",
|
|
16
|
-
"require": "./src/resetcss.css"
|
|
17
13
|
}
|
|
18
14
|
},
|
|
19
15
|
"files": [
|
|
@@ -30,7 +26,6 @@
|
|
|
30
26
|
"url": "https://github.com/Tencent/tmagic-editor.git"
|
|
31
27
|
},
|
|
32
28
|
"dependencies": {
|
|
33
|
-
"dayjs": "^1.11.11",
|
|
34
29
|
"lodash-es": "^4.17.21"
|
|
35
30
|
},
|
|
36
31
|
"devDependencies": {
|
|
@@ -41,7 +36,7 @@
|
|
|
41
36
|
},
|
|
42
37
|
"peerDependencies": {
|
|
43
38
|
"typescript": "*",
|
|
44
|
-
"@tmagic/schema": "1.5.0-beta.
|
|
39
|
+
"@tmagic/schema": "1.5.0-beta.5"
|
|
45
40
|
},
|
|
46
41
|
"peerDependenciesMeta": {
|
|
47
42
|
"typescript": {
|
package/src/index.ts
CHANGED
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import dayjs from 'dayjs';
|
|
20
|
-
import utc from 'dayjs/plugin/utc';
|
|
21
19
|
import { cloneDeep, set as objectSet } from 'lodash-es';
|
|
22
20
|
|
|
23
21
|
import type { DataSchema, DataSourceDeps, Id, MComponent, MNode, MNodeInstance } from '@tmagic/schema';
|
|
@@ -33,31 +31,6 @@ export const sleep = (ms: number): Promise<void> =>
|
|
|
33
31
|
}, ms);
|
|
34
32
|
});
|
|
35
33
|
|
|
36
|
-
export const datetimeFormatter = (
|
|
37
|
-
v: string | Date,
|
|
38
|
-
defaultValue = '-',
|
|
39
|
-
format = 'YYYY-MM-DD HH:mm:ss',
|
|
40
|
-
): string | number => {
|
|
41
|
-
if (v) {
|
|
42
|
-
let time: string | number;
|
|
43
|
-
if (['x', 'timestamp'].includes(format)) {
|
|
44
|
-
time = dayjs(v).valueOf();
|
|
45
|
-
} else if ((typeof v === 'string' && v.includes('Z')) || v.constructor === Date) {
|
|
46
|
-
dayjs.extend(utc);
|
|
47
|
-
// UTC字符串时间或Date对象格式化为北京时间
|
|
48
|
-
time = dayjs(v).utcOffset(8).format(format);
|
|
49
|
-
} else {
|
|
50
|
-
time = dayjs(v).format(format);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (time !== 'Invalid Date') {
|
|
54
|
-
return time;
|
|
55
|
-
}
|
|
56
|
-
return defaultValue;
|
|
57
|
-
}
|
|
58
|
-
return defaultValue;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
34
|
// 驼峰转换横线
|
|
62
35
|
export const toLine = (name = '') => name.replace(/\B([A-Z])/g, '-$1').toLowerCase();
|
|
63
36
|
|
package/types/index.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ declare const getElById: () => (doc?: Document, id?: string | number) => HTMLEle
|
|
|
23
23
|
declare const setIdToEl: () => (el: HTMLElement | SVGElement, id: string | number) => void;
|
|
24
24
|
|
|
25
25
|
declare const sleep: (ms: number) => Promise<void>;
|
|
26
|
-
declare const datetimeFormatter: (v: string | Date, defaultValue?: string, format?: string) => string | number;
|
|
27
26
|
declare const toLine: (name?: string) => string;
|
|
28
27
|
declare const toHump: (name?: string) => string;
|
|
29
28
|
declare const emptyFn: () => any;
|
|
@@ -83,4 +82,4 @@ declare const addParamToUrl: (obj: Record<string, any>, global?: typeof globalTh
|
|
|
83
82
|
declare const dataSourceTemplateRegExp: RegExp;
|
|
84
83
|
declare const isDslNode: (config: MNodeInstance) => boolean;
|
|
85
84
|
|
|
86
|
-
export { DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, DSL_NODE_KEY_COPY_PREFIX, IS_DSL_NODE_KEY, addClassName, addParamToUrl, asyncLoadCss, asyncLoadJs, calcValueByFontsize, calculatePercentage, compiledCond, compiledNode, convertToNumber, createDiv, dataSourceTemplateRegExp,
|
|
85
|
+
export { DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, DSL_NODE_KEY_COPY_PREFIX, IS_DSL_NODE_KEY, addClassName, addParamToUrl, asyncLoadCss, asyncLoadJs, calcValueByFontsize, calculatePercentage, compiledCond, compiledNode, convertToNumber, createDiv, dataSourceTemplateRegExp, emptyFn, filterXSS, getDefaultValueFromFields, getDepKeys, getDepNodeIds, getDocument, getElById, getHost, getIdFromEl, getKeys, getKeysArray, getNodePath, getNodes, getUrlParam, getValueByKeyPath, guid, injectStyle, isDslNode, isNumber, isObject, isPage, isPageFragment, isPercentage, isPop, isSameDomain, removeClassName, removeClassNameByClassName, replaceChildNode, setDslDomRelateConfig, setIdToEl, setValueByKeyPath, sleep, toHump, toLine };
|
package/src/resetcss.css
DELETED
|
@@ -1,446 +0,0 @@
|
|
|
1
|
-
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
|
-
v2.0-modified | 20110126
|
|
3
|
-
License: none (public domain)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
html,
|
|
7
|
-
body,
|
|
8
|
-
div,
|
|
9
|
-
span,
|
|
10
|
-
applet,
|
|
11
|
-
object,
|
|
12
|
-
iframe,
|
|
13
|
-
h1,
|
|
14
|
-
h2,
|
|
15
|
-
h3,
|
|
16
|
-
h4,
|
|
17
|
-
h5,
|
|
18
|
-
h6,
|
|
19
|
-
p,
|
|
20
|
-
blockquote,
|
|
21
|
-
pre,
|
|
22
|
-
a,
|
|
23
|
-
abbr,
|
|
24
|
-
acronym,
|
|
25
|
-
address,
|
|
26
|
-
big,
|
|
27
|
-
cite,
|
|
28
|
-
code,
|
|
29
|
-
del,
|
|
30
|
-
dfn,
|
|
31
|
-
em,
|
|
32
|
-
img,
|
|
33
|
-
ins,
|
|
34
|
-
kbd,
|
|
35
|
-
q,
|
|
36
|
-
s,
|
|
37
|
-
samp,
|
|
38
|
-
small,
|
|
39
|
-
strike,
|
|
40
|
-
strong,
|
|
41
|
-
sub,
|
|
42
|
-
sup,
|
|
43
|
-
tt,
|
|
44
|
-
var,
|
|
45
|
-
b,
|
|
46
|
-
u,
|
|
47
|
-
i,
|
|
48
|
-
center,
|
|
49
|
-
dl,
|
|
50
|
-
dt,
|
|
51
|
-
dd,
|
|
52
|
-
ol,
|
|
53
|
-
ul,
|
|
54
|
-
li,
|
|
55
|
-
fieldset,
|
|
56
|
-
form,
|
|
57
|
-
label,
|
|
58
|
-
legend,
|
|
59
|
-
table,
|
|
60
|
-
caption,
|
|
61
|
-
tbody,
|
|
62
|
-
tfoot,
|
|
63
|
-
thead,
|
|
64
|
-
tr,
|
|
65
|
-
th,
|
|
66
|
-
td,
|
|
67
|
-
article,
|
|
68
|
-
aside,
|
|
69
|
-
canvas,
|
|
70
|
-
details,
|
|
71
|
-
embed,
|
|
72
|
-
figure,
|
|
73
|
-
figcaption,
|
|
74
|
-
footer,
|
|
75
|
-
header,
|
|
76
|
-
hgroup,
|
|
77
|
-
menu,
|
|
78
|
-
nav,
|
|
79
|
-
output,
|
|
80
|
-
ruby,
|
|
81
|
-
section,
|
|
82
|
-
summary,
|
|
83
|
-
time,
|
|
84
|
-
mark,
|
|
85
|
-
audio,
|
|
86
|
-
video {
|
|
87
|
-
margin: 0;
|
|
88
|
-
padding: 0;
|
|
89
|
-
border: 0;
|
|
90
|
-
font-size: 100%;
|
|
91
|
-
font: inherit;
|
|
92
|
-
vertical-align: baseline;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/* make sure to set some focus styles for accessibility */
|
|
96
|
-
:focus {
|
|
97
|
-
outline: 0;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* HTML5 display-role reset for older browsers */
|
|
101
|
-
article,
|
|
102
|
-
aside,
|
|
103
|
-
details,
|
|
104
|
-
figcaption,
|
|
105
|
-
figure,
|
|
106
|
-
footer,
|
|
107
|
-
header,
|
|
108
|
-
hgroup,
|
|
109
|
-
menu,
|
|
110
|
-
nav,
|
|
111
|
-
section {
|
|
112
|
-
display: block;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
body {
|
|
116
|
-
line-height: 1;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
ol,
|
|
120
|
-
ul {
|
|
121
|
-
list-style: none;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
blockquote,
|
|
125
|
-
q {
|
|
126
|
-
quotes: none;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
blockquote:before,
|
|
130
|
-
blockquote:after,
|
|
131
|
-
q:before,
|
|
132
|
-
q:after {
|
|
133
|
-
content: '';
|
|
134
|
-
content: none;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
table {
|
|
138
|
-
border-collapse: collapse;
|
|
139
|
-
border-spacing: 0;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
input[type='search']::-webkit-search-cancel-button,
|
|
143
|
-
input[type='search']::-webkit-search-decoration,
|
|
144
|
-
input[type='search']::-webkit-search-results-button,
|
|
145
|
-
input[type='search']::-webkit-search-results-decoration {
|
|
146
|
-
-webkit-appearance: none;
|
|
147
|
-
-moz-appearance: none;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
input[type='search'] {
|
|
151
|
-
-webkit-appearance: none;
|
|
152
|
-
-moz-appearance: none;
|
|
153
|
-
-webkit-box-sizing: content-box;
|
|
154
|
-
-moz-box-sizing: content-box;
|
|
155
|
-
box-sizing: content-box;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
textarea {
|
|
159
|
-
overflow: auto;
|
|
160
|
-
vertical-align: top;
|
|
161
|
-
resize: vertical;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
audio,
|
|
169
|
-
canvas,
|
|
170
|
-
video {
|
|
171
|
-
display: inline-block;
|
|
172
|
-
*display: inline;
|
|
173
|
-
*zoom: 1;
|
|
174
|
-
max-width: 100%;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Prevent modern browsers from displaying `audio` without controls.
|
|
179
|
-
* Remove excess height in iOS 5 devices.
|
|
180
|
-
*/
|
|
181
|
-
|
|
182
|
-
audio:not([controls]) {
|
|
183
|
-
display: none;
|
|
184
|
-
height: 0;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.
|
|
189
|
-
* Known issue: no IE 6 support.
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
[hidden] {
|
|
193
|
-
display: none;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using
|
|
198
|
-
* `em` units.
|
|
199
|
-
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
|
200
|
-
* user zoom.
|
|
201
|
-
*/
|
|
202
|
-
|
|
203
|
-
html {
|
|
204
|
-
font-size: 100%; /* 1 */
|
|
205
|
-
-webkit-text-size-adjust: 100%; /* 2 */
|
|
206
|
-
-ms-text-size-adjust: 100%; /* 2 */
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Address `outline` inconsistency between Chrome and other browsers.
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
a:focus {
|
|
214
|
-
outline: thin dotted;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Improve readability when focused and also mouse hovered in all browsers.
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
a:active,
|
|
222
|
-
a:hover {
|
|
223
|
-
outline: 0;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.
|
|
228
|
-
* 2. Improve image quality when scaled in IE 7.
|
|
229
|
-
*/
|
|
230
|
-
|
|
231
|
-
img {
|
|
232
|
-
border: 0; /* 1 */
|
|
233
|
-
-ms-interpolation-mode: bicubic; /* 2 */
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
|
|
238
|
-
*/
|
|
239
|
-
|
|
240
|
-
figure {
|
|
241
|
-
margin: 0;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Correct margin displayed oddly in IE 6/7.
|
|
246
|
-
*/
|
|
247
|
-
|
|
248
|
-
form {
|
|
249
|
-
margin: 0;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Define consistent border, margin, and padding.
|
|
254
|
-
*/
|
|
255
|
-
|
|
256
|
-
fieldset {
|
|
257
|
-
border: 1px solid #c0c0c0;
|
|
258
|
-
margin: 0 2px;
|
|
259
|
-
padding: 0.35em 0.625em 0.75em;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* 1. Correct color not being inherited in IE 6/7/8/9.
|
|
264
|
-
* 2. Correct text not wrapping in Firefox 3.
|
|
265
|
-
* 3. Correct alignment displayed oddly in IE 6/7.
|
|
266
|
-
*/
|
|
267
|
-
|
|
268
|
-
legend {
|
|
269
|
-
border: 0; /* 1 */
|
|
270
|
-
padding: 0;
|
|
271
|
-
white-space: normal; /* 2 */
|
|
272
|
-
*margin-left: -7px; /* 3 */
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* 1. Correct font size not being inherited in all browsers.
|
|
277
|
-
* 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,
|
|
278
|
-
* and Chrome.
|
|
279
|
-
* 3. Improve appearance and consistency in all browsers.
|
|
280
|
-
*/
|
|
281
|
-
|
|
282
|
-
button,
|
|
283
|
-
input,
|
|
284
|
-
select,
|
|
285
|
-
textarea {
|
|
286
|
-
font-size: 100%; /* 1 */
|
|
287
|
-
margin: 0; /* 2 */
|
|
288
|
-
vertical-align: baseline; /* 3 */
|
|
289
|
-
*vertical-align: middle; /* 3 */
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Address Firefox 3+ setting `line-height` on `input` using `!important` in
|
|
294
|
-
* the UA stylesheet.
|
|
295
|
-
*/
|
|
296
|
-
|
|
297
|
-
button,
|
|
298
|
-
input {
|
|
299
|
-
line-height: normal;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
|
304
|
-
* All other form control elements do not inherit `text-transform` values.
|
|
305
|
-
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.
|
|
306
|
-
* Correct `select` style inheritance in Firefox 4+ and Opera.
|
|
307
|
-
*/
|
|
308
|
-
|
|
309
|
-
button,
|
|
310
|
-
select {
|
|
311
|
-
text-transform: none;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
|
316
|
-
* and `video` controls.
|
|
317
|
-
* 2. Correct inability to style clickable `input` types in iOS.
|
|
318
|
-
* 3. Improve usability and consistency of cursor style between image-type
|
|
319
|
-
* `input` and others.
|
|
320
|
-
* 4. Remove inner spacing in IE 7 without affecting normal text inputs.
|
|
321
|
-
* Known issue: inner spacing remains in IE 6.
|
|
322
|
-
*/
|
|
323
|
-
|
|
324
|
-
button,
|
|
325
|
-
html input[type="button"], /* 1 */
|
|
326
|
-
input[type="reset"],
|
|
327
|
-
input[type="submit"] {
|
|
328
|
-
-webkit-appearance: button; /* 2 */
|
|
329
|
-
cursor: pointer; /* 3 */
|
|
330
|
-
*overflow: visible; /* 4 */
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Re-set default cursor for disabled elements.
|
|
335
|
-
*/
|
|
336
|
-
|
|
337
|
-
button[disabled],
|
|
338
|
-
html input[disabled] {
|
|
339
|
-
cursor: default;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* 1. Address box sizing set to content-box in IE 8/9.
|
|
344
|
-
* 2. Remove excess padding in IE 8/9.
|
|
345
|
-
* 3. Remove excess padding in IE 7.
|
|
346
|
-
* Known issue: excess padding remains in IE 6.
|
|
347
|
-
*/
|
|
348
|
-
|
|
349
|
-
input[type='checkbox'],
|
|
350
|
-
input[type='radio'] {
|
|
351
|
-
box-sizing: border-box; /* 1 */
|
|
352
|
-
padding: 0; /* 2 */
|
|
353
|
-
*height: 13px; /* 3 */
|
|
354
|
-
*width: 13px; /* 3 */
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
|
|
359
|
-
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
|
|
360
|
-
* (include `-moz` to future-proof).
|
|
361
|
-
*/
|
|
362
|
-
|
|
363
|
-
input[type='search'] {
|
|
364
|
-
-webkit-appearance: textfield; /* 1 */
|
|
365
|
-
-moz-box-sizing: content-box;
|
|
366
|
-
-webkit-box-sizing: content-box; /* 2 */
|
|
367
|
-
box-sizing: content-box;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Remove inner padding and search cancel button in Safari 5 and Chrome
|
|
372
|
-
* on OS X.
|
|
373
|
-
*/
|
|
374
|
-
|
|
375
|
-
input[type='search']::-webkit-search-cancel-button,
|
|
376
|
-
input[type='search']::-webkit-search-decoration {
|
|
377
|
-
-webkit-appearance: none;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Remove inner padding and border in Firefox 3+.
|
|
382
|
-
*/
|
|
383
|
-
|
|
384
|
-
button::-moz-focus-inner,
|
|
385
|
-
input::-moz-focus-inner {
|
|
386
|
-
border: 0;
|
|
387
|
-
padding: 0;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* 1. Remove default vertical scrollbar in IE 6/7/8/9.
|
|
392
|
-
* 2. Improve readability and alignment in all browsers.
|
|
393
|
-
*/
|
|
394
|
-
|
|
395
|
-
textarea {
|
|
396
|
-
overflow: auto; /* 1 */
|
|
397
|
-
vertical-align: top; /* 2 */
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* Remove most spacing between table cells.
|
|
402
|
-
*/
|
|
403
|
-
|
|
404
|
-
table {
|
|
405
|
-
border-collapse: collapse;
|
|
406
|
-
border-spacing: 0;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
html,
|
|
410
|
-
button,
|
|
411
|
-
input,
|
|
412
|
-
select,
|
|
413
|
-
textarea {
|
|
414
|
-
color: #222;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
::-moz-selection {
|
|
418
|
-
background: #b3d4fc;
|
|
419
|
-
text-shadow: none;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
::selection {
|
|
423
|
-
background: #b3d4fc;
|
|
424
|
-
text-shadow: none;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
img {
|
|
428
|
-
vertical-align: middle;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
fieldset {
|
|
432
|
-
border: 0;
|
|
433
|
-
margin: 0;
|
|
434
|
-
padding: 0;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
textarea {
|
|
438
|
-
resize: vertical;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.chromeframe {
|
|
442
|
-
margin: 0.2em 0;
|
|
443
|
-
background: #ccc;
|
|
444
|
-
color: #000;
|
|
445
|
-
padding: 0.2em 0;
|
|
446
|
-
}
|