cnhis-design-vue 3.1.15-beta.4 → 3.1.15-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/es/packages/bpmn-workflow/src/BpmnWorkflow.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.js +8 -8
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomContextPadProvider.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPalette.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRenderer.js +4 -3
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRules.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/index.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/CustomPopupMenu.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/zoomScroll.js +3 -3
- package/es/packages/field-set/index.d.ts +4365 -0
- package/es/packages/field-set/src/FieldSet.js +53 -54
- package/es/packages/field-set/src/FieldSet.vue.d.ts +4365 -0
- package/es/packages/field-set/style/index.css +0 -9
- package/es/packages/form-render/index.d.ts +24 -3
- package/es/packages/form-render/src/FormRender.js +10 -6
- package/es/packages/form-render/src/FormRender.vue.d.ts +24 -3
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.d.ts +5 -0
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.js +32 -0
- package/es/packages/form-render/src/components/renderer/{combination.d.ts → combination/index.d.ts} +7 -1
- package/es/packages/form-render/src/components/renderer/combination/index.js +157 -0
- package/es/packages/form-render/src/components/renderer/date.d.ts +2 -2
- package/es/packages/form-render/src/components/renderer/index.js +1 -1
- package/es/packages/form-render/src/components/renderer/radio.js +4 -1
- package/es/packages/form-render/src/components/renderer/select.d.ts +9 -0
- package/es/packages/form-render/src/components/renderer/select.js +5 -1
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +7 -6
- package/es/packages/form-render/src/hooks/useAnchor.js +1 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +6 -1
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +11 -2
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +2 -4
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +3 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +15 -3
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +13 -0
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.js +10 -0
- package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/packages/form-render/src/types/index.d.ts +25 -1
- package/es/packages/form-render/src/utils/index.d.ts +3 -3
- package/es/packages/form-render/src/utils/index.js +1 -4
- package/es/packages/index.css +0 -9
- package/es/packages/info-header/index.d.ts +1 -3
- package/es/packages/info-header/src/HiddenContent.js +1 -1
- package/es/packages/info-header/src/HiddenContent.vue.d.ts +1 -3
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +1 -3
- package/es/packages/shortcut-setter/index.d.ts +25 -4
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +25 -4
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +2 -2
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +1 -1
- package/global.d.ts +8 -8
- package/package.json +9 -1
- package/es/_virtual/_commonjsHelpers.js +0 -7
- package/es/_virtual/css.escape.js +0 -3
- package/es/_virtual/inherits.js +0 -3
- package/es/_virtual/inherits_browser.js +0 -3
- package/es/node_modules/@formily/path/esm/contexts.js +0 -22
- package/es/node_modules/@formily/path/esm/destructor.js +0 -124
- package/es/node_modules/@formily/path/esm/index.js +0 -579
- package/es/node_modules/@formily/path/esm/matcher.js +0 -199
- package/es/node_modules/@formily/path/esm/parser.js +0 -402
- package/es/node_modules/@formily/path/esm/shared.js +0 -73
- package/es/node_modules/@formily/path/esm/tokenizer.js +0 -287
- package/es/node_modules/@formily/path/esm/tokens.js +0 -240
- package/es/node_modules/@formily/path/esm/types.js +0 -17
- package/es/node_modules/css.escape/css.escape.js +0 -110
- package/es/node_modules/date-fns/esm/_lib/defaultOptions/index.js +0 -6
- package/es/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -18
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/getUTCWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +0 -38
- package/es/node_modules/date-fns/esm/_lib/requiredArgs/index.js +0 -7
- package/es/node_modules/date-fns/esm/_lib/setUTCDay/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/setUTCISODay/index.js +0 -23
- package/es/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/setUTCWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +0 -25
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +0 -21
- package/es/node_modules/date-fns/esm/_lib/toInteger/index.js +0 -15
- package/es/node_modules/date-fns/esm/compareAsc/index.js +0 -52
- package/es/node_modules/date-fns/esm/constants/index.js +0 -40
- package/es/node_modules/date-fns/esm/differenceInCalendarDays/index.js +0 -49
- package/es/node_modules/date-fns/esm/differenceInCalendarMonths/index.js +0 -35
- package/es/node_modules/date-fns/esm/differenceInCalendarYears/index.js +0 -33
- package/es/node_modules/date-fns/esm/differenceInDays/index.js +0 -86
- package/es/node_modules/date-fns/esm/differenceInMonths/index.js +0 -59
- package/es/node_modules/date-fns/esm/differenceInYears/index.js +0 -43
- package/es/node_modules/date-fns/esm/endOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/endOfMonth/index.js +0 -32
- package/es/node_modules/date-fns/esm/isLastDayOfMonth/index.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/Parser.js +0 -32
- package/es/node_modules/date-fns/esm/parse/_lib/Setter.js +0 -37
- package/es/node_modules/date-fns/esm/parse/_lib/constants.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js +0 -52
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js +0 -56
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js +0 -53
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js +0 -29
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js +0 -42
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js +0 -50
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js +0 -99
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js +0 -33
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js +0 -61
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js +0 -66
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/index.js +0 -109
- package/es/node_modules/date-fns/esm/parse/_lib/utils.js +0 -133
- package/es/node_modules/date-fns/esm/startOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/toDate/index.js +0 -55
- package/es/node_modules/diagram-js/lib/command/CommandInterceptor.js +0 -139
- package/es/node_modules/diagram-js/lib/draw/BaseRenderer.js +0 -88
- package/es/node_modules/diagram-js/lib/features/popup-menu/PopupMenu.js +0 -591
- package/es/node_modules/diagram-js/lib/features/rules/RuleProvider.js +0 -88
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js +0 -120
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/index.js +0 -8
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js +0 -227
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomUtil.js +0 -24
- package/es/node_modules/diagram-js/lib/util/ClickTrap.js +0 -23
- package/es/node_modules/diagram-js/lib/util/Cursor.js +0 -20
- package/es/node_modules/diagram-js/lib/util/Event.js +0 -22
- package/es/node_modules/diagram-js/lib/util/Math.js +0 -9
- package/es/node_modules/diagram-js/lib/util/Mouse.js +0 -30
- package/es/node_modules/diagram-js/lib/util/Platform.js +0 -5
- package/es/node_modules/diagram-js/lib/util/PositionUtil.js +0 -8
- package/es/node_modules/diagram-js/lib/util/RenderUtil.js +0 -25
- package/es/node_modules/diagram-js/lib/util/SvgTransformUtil.js +0 -48
- package/es/node_modules/ids/dist/index.esm.js +0 -164
- package/es/node_modules/inherits/inherits.js +0 -19
- package/es/node_modules/inherits/inherits_browser.js +0 -38
- package/es/node_modules/inherits-browser/dist/index.es.js +0 -3
- package/es/node_modules/min-dash/dist/index.esm.js +0 -169
- package/es/node_modules/min-dom/dist/index.esm.js +0 -588
- package/es/node_modules/tiny-svg/dist/index.esm.js +0 -525
- package/es/packages/form-render/src/components/renderer/combination.js +0 -171
|
@@ -1,588 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flatten array, one level deep.
|
|
3
|
-
*
|
|
4
|
-
* @param {Array<?>} arr
|
|
5
|
-
*
|
|
6
|
-
* @return {Array<?>}
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
var nativeToString = Object.prototype.toString;
|
|
10
|
-
var nativeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
11
|
-
function isUndefined(obj) {
|
|
12
|
-
return obj === undefined;
|
|
13
|
-
}
|
|
14
|
-
function isArray(obj) {
|
|
15
|
-
return nativeToString.call(obj) === '[object Array]';
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Return true, if target owns a property with the given key.
|
|
19
|
-
*
|
|
20
|
-
* @param {Object} target
|
|
21
|
-
* @param {String} key
|
|
22
|
-
*
|
|
23
|
-
* @return {Boolean}
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
function has(target, key) {
|
|
27
|
-
return nativeHasOwnProperty.call(target, key);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Iterate over collection; returning something
|
|
31
|
-
* (non-undefined) will stop iteration.
|
|
32
|
-
*
|
|
33
|
-
* @param {Array|Object} collection
|
|
34
|
-
* @param {Function} iterator
|
|
35
|
-
*
|
|
36
|
-
* @return {Object} return result that stopped the iteration
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
function forEach(collection, iterator) {
|
|
40
|
-
var val, result;
|
|
41
|
-
|
|
42
|
-
if (isUndefined(collection)) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var convertKey = isArray(collection) ? toNum : identity;
|
|
47
|
-
|
|
48
|
-
for (var key in collection) {
|
|
49
|
-
if (has(collection, key)) {
|
|
50
|
-
val = collection[key];
|
|
51
|
-
result = iterator(val, convertKey(key));
|
|
52
|
-
|
|
53
|
-
if (result === false) {
|
|
54
|
-
return val;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function identity(arg) {
|
|
61
|
-
return arg;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function toNum(arg) {
|
|
65
|
-
return Number(arg);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Assigns style attributes in a style-src compliant way.
|
|
70
|
-
*
|
|
71
|
-
* @param {Element} element
|
|
72
|
-
* @param {...Object} styleSources
|
|
73
|
-
*
|
|
74
|
-
* @return {Element} the element
|
|
75
|
-
*/
|
|
76
|
-
function assign$1(element) {
|
|
77
|
-
var target = element.style;
|
|
78
|
-
|
|
79
|
-
for (var _len = arguments.length, styleSources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
80
|
-
styleSources[_key - 1] = arguments[_key];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
forEach(styleSources, function (style) {
|
|
84
|
-
if (!style) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
forEach(style, function (value, key) {
|
|
89
|
-
target[key] = value;
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
return element;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Set attribute `name` to `val`, or get attr `name`.
|
|
98
|
-
*
|
|
99
|
-
* @param {Element} el
|
|
100
|
-
* @param {String} name
|
|
101
|
-
* @param {String} [val]
|
|
102
|
-
* @api public
|
|
103
|
-
*/
|
|
104
|
-
function attr(el, name, val) {
|
|
105
|
-
// get
|
|
106
|
-
if (arguments.length == 2) {
|
|
107
|
-
return el.getAttribute(name);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// remove
|
|
111
|
-
if (val === null) {
|
|
112
|
-
return el.removeAttribute(name);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// set
|
|
116
|
-
el.setAttribute(name, val);
|
|
117
|
-
|
|
118
|
-
return el;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
var indexOf = [].indexOf;
|
|
122
|
-
|
|
123
|
-
var indexof = function(arr, obj){
|
|
124
|
-
if (indexOf) return arr.indexOf(obj);
|
|
125
|
-
for (var i = 0; i < arr.length; ++i) {
|
|
126
|
-
if (arr[i] === obj) return i;
|
|
127
|
-
}
|
|
128
|
-
return -1;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Taken from https://github.com/component/classes
|
|
133
|
-
*
|
|
134
|
-
* Without the component bits.
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Whitespace regexp.
|
|
139
|
-
*/
|
|
140
|
-
|
|
141
|
-
var re = /\s+/;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* toString reference.
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
var toString = Object.prototype.toString;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Wrap `el` in a `ClassList`.
|
|
151
|
-
*
|
|
152
|
-
* @param {Element} el
|
|
153
|
-
* @return {ClassList}
|
|
154
|
-
* @api public
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
function classes(el) {
|
|
158
|
-
return new ClassList(el);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Initialize a new ClassList for `el`.
|
|
163
|
-
*
|
|
164
|
-
* @param {Element} el
|
|
165
|
-
* @api private
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
function ClassList(el) {
|
|
169
|
-
if (!el || !el.nodeType) {
|
|
170
|
-
throw new Error('A DOM element reference is required');
|
|
171
|
-
}
|
|
172
|
-
this.el = el;
|
|
173
|
-
this.list = el.classList;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Add class `name` if not already present.
|
|
178
|
-
*
|
|
179
|
-
* @param {String} name
|
|
180
|
-
* @return {ClassList}
|
|
181
|
-
* @api public
|
|
182
|
-
*/
|
|
183
|
-
|
|
184
|
-
ClassList.prototype.add = function (name) {
|
|
185
|
-
// classList
|
|
186
|
-
if (this.list) {
|
|
187
|
-
this.list.add(name);
|
|
188
|
-
return this;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// fallback
|
|
192
|
-
var arr = this.array();
|
|
193
|
-
var i = indexof(arr, name);
|
|
194
|
-
if (!~i) arr.push(name);
|
|
195
|
-
this.el.className = arr.join(' ');
|
|
196
|
-
return this;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Remove class `name` when present, or
|
|
201
|
-
* pass a regular expression to remove
|
|
202
|
-
* any which match.
|
|
203
|
-
*
|
|
204
|
-
* @param {String|RegExp} name
|
|
205
|
-
* @return {ClassList}
|
|
206
|
-
* @api public
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
ClassList.prototype.remove = function (name) {
|
|
210
|
-
if ('[object RegExp]' == toString.call(name)) {
|
|
211
|
-
return this.removeMatching(name);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// classList
|
|
215
|
-
if (this.list) {
|
|
216
|
-
this.list.remove(name);
|
|
217
|
-
return this;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// fallback
|
|
221
|
-
var arr = this.array();
|
|
222
|
-
var i = indexof(arr, name);
|
|
223
|
-
if (~i) arr.splice(i, 1);
|
|
224
|
-
this.el.className = arr.join(' ');
|
|
225
|
-
return this;
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Remove all classes matching `re`.
|
|
230
|
-
*
|
|
231
|
-
* @param {RegExp} re
|
|
232
|
-
* @return {ClassList}
|
|
233
|
-
* @api private
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
ClassList.prototype.removeMatching = function (re) {
|
|
237
|
-
var arr = this.array();
|
|
238
|
-
for (var i = 0; i < arr.length; i++) {
|
|
239
|
-
if (re.test(arr[i])) {
|
|
240
|
-
this.remove(arr[i]);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return this;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Toggle class `name`, can force state via `force`.
|
|
248
|
-
*
|
|
249
|
-
* For browsers that support classList, but do not support `force` yet,
|
|
250
|
-
* the mistake will be detected and corrected.
|
|
251
|
-
*
|
|
252
|
-
* @param {String} name
|
|
253
|
-
* @param {Boolean} force
|
|
254
|
-
* @return {ClassList}
|
|
255
|
-
* @api public
|
|
256
|
-
*/
|
|
257
|
-
|
|
258
|
-
ClassList.prototype.toggle = function (name, force) {
|
|
259
|
-
// classList
|
|
260
|
-
if (this.list) {
|
|
261
|
-
if ('undefined' !== typeof force) {
|
|
262
|
-
if (force !== this.list.toggle(name, force)) {
|
|
263
|
-
this.list.toggle(name); // toggle again to correct
|
|
264
|
-
}
|
|
265
|
-
} else {
|
|
266
|
-
this.list.toggle(name);
|
|
267
|
-
}
|
|
268
|
-
return this;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// fallback
|
|
272
|
-
if ('undefined' !== typeof force) {
|
|
273
|
-
if (!force) {
|
|
274
|
-
this.remove(name);
|
|
275
|
-
} else {
|
|
276
|
-
this.add(name);
|
|
277
|
-
}
|
|
278
|
-
} else {
|
|
279
|
-
if (this.has(name)) {
|
|
280
|
-
this.remove(name);
|
|
281
|
-
} else {
|
|
282
|
-
this.add(name);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return this;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Return an array of classes.
|
|
291
|
-
*
|
|
292
|
-
* @return {Array}
|
|
293
|
-
* @api public
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
ClassList.prototype.array = function () {
|
|
297
|
-
var className = this.el.getAttribute('class') || '';
|
|
298
|
-
var str = className.replace(/^\s+|\s+$/g, '');
|
|
299
|
-
var arr = str.split(re);
|
|
300
|
-
if ('' === arr[0]) arr.shift();
|
|
301
|
-
return arr;
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Check if class `name` is present.
|
|
306
|
-
*
|
|
307
|
-
* @param {String} name
|
|
308
|
-
* @return {ClassList}
|
|
309
|
-
* @api public
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
ClassList.prototype.has = ClassList.prototype.contains = function (name) {
|
|
313
|
-
return this.list ? this.list.contains(name) : !!~indexof(this.array(), name);
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
var proto = typeof Element !== 'undefined' ? Element.prototype : {};
|
|
317
|
-
var vendor = proto.matches
|
|
318
|
-
|| proto.matchesSelector
|
|
319
|
-
|| proto.webkitMatchesSelector
|
|
320
|
-
|| proto.mozMatchesSelector
|
|
321
|
-
|| proto.msMatchesSelector
|
|
322
|
-
|| proto.oMatchesSelector;
|
|
323
|
-
|
|
324
|
-
var matchesSelector = match;
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Match `el` to `selector`.
|
|
328
|
-
*
|
|
329
|
-
* @param {Element} el
|
|
330
|
-
* @param {String} selector
|
|
331
|
-
* @return {Boolean}
|
|
332
|
-
* @api public
|
|
333
|
-
*/
|
|
334
|
-
|
|
335
|
-
function match(el, selector) {
|
|
336
|
-
if (!el || el.nodeType !== 1) return false;
|
|
337
|
-
if (vendor) return vendor.call(el, selector);
|
|
338
|
-
var nodes = el.parentNode.querySelectorAll(selector);
|
|
339
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
340
|
-
if (nodes[i] == el) return true;
|
|
341
|
-
}
|
|
342
|
-
return false;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Closest
|
|
347
|
-
*
|
|
348
|
-
* @param {Element} el
|
|
349
|
-
* @param {String} selector
|
|
350
|
-
* @param {Boolean} checkYourSelf (optional)
|
|
351
|
-
*/
|
|
352
|
-
function closest (element, selector, checkYourSelf) {
|
|
353
|
-
var currentElem = checkYourSelf ? element : element.parentNode;
|
|
354
|
-
|
|
355
|
-
while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE && currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {
|
|
356
|
-
|
|
357
|
-
if (matchesSelector(currentElem, selector)) {
|
|
358
|
-
return currentElem;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
currentElem = currentElem.parentNode;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
return matchesSelector(currentElem, selector) ? currentElem : null;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
var bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent',
|
|
368
|
-
unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
|
|
369
|
-
prefix = bind$1 !== 'addEventListener' ? 'on' : '';
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Bind `el` event `type` to `fn`.
|
|
373
|
-
*
|
|
374
|
-
* @param {Element} el
|
|
375
|
-
* @param {String} type
|
|
376
|
-
* @param {Function} fn
|
|
377
|
-
* @param {Boolean} capture
|
|
378
|
-
* @return {Function}
|
|
379
|
-
* @api public
|
|
380
|
-
*/
|
|
381
|
-
|
|
382
|
-
var bind_1 = function(el, type, fn, capture){
|
|
383
|
-
el[bind$1](prefix + type, fn, capture || false);
|
|
384
|
-
return fn;
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Unbind `el` event `type`'s callback `fn`.
|
|
389
|
-
*
|
|
390
|
-
* @param {Element} el
|
|
391
|
-
* @param {String} type
|
|
392
|
-
* @param {Function} fn
|
|
393
|
-
* @param {Boolean} capture
|
|
394
|
-
* @return {Function}
|
|
395
|
-
* @api public
|
|
396
|
-
*/
|
|
397
|
-
|
|
398
|
-
var unbind_1 = function(el, type, fn, capture){
|
|
399
|
-
el[unbind](prefix + type, fn, capture || false);
|
|
400
|
-
return fn;
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
var componentEvent = {
|
|
404
|
-
bind: bind_1,
|
|
405
|
-
unbind: unbind_1
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Module dependencies.
|
|
410
|
-
*/
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Delegate event `type` to `selector`
|
|
414
|
-
* and invoke `fn(e)`. A callback function
|
|
415
|
-
* is returned which may be passed to `.unbind()`.
|
|
416
|
-
*
|
|
417
|
-
* @param {Element} el
|
|
418
|
-
* @param {String} selector
|
|
419
|
-
* @param {String} type
|
|
420
|
-
* @param {Function} fn
|
|
421
|
-
* @param {Boolean} capture
|
|
422
|
-
* @return {Function}
|
|
423
|
-
* @api public
|
|
424
|
-
*/
|
|
425
|
-
|
|
426
|
-
// Some events don't bubble, so we want to bind to the capture phase instead
|
|
427
|
-
// when delegating.
|
|
428
|
-
var forceCaptureEvents = ['focus', 'blur'];
|
|
429
|
-
|
|
430
|
-
function bind$2(el, selector, type, fn, capture) {
|
|
431
|
-
if (forceCaptureEvents.indexOf(type) !== -1) {
|
|
432
|
-
capture = true;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
return componentEvent.bind(el, type, function (e) {
|
|
436
|
-
var target = e.target || e.srcElement;
|
|
437
|
-
e.delegateTarget = closest(target, selector, true);
|
|
438
|
-
if (e.delegateTarget) {
|
|
439
|
-
fn.call(el, e);
|
|
440
|
-
}
|
|
441
|
-
}, capture);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* Unbind event `type`'s callback `fn`.
|
|
446
|
-
*
|
|
447
|
-
* @param {Element} el
|
|
448
|
-
* @param {String} type
|
|
449
|
-
* @param {Function} fn
|
|
450
|
-
* @param {Boolean} capture
|
|
451
|
-
* @api public
|
|
452
|
-
*/
|
|
453
|
-
function unbind$1(el, type, fn, capture) {
|
|
454
|
-
if (forceCaptureEvents.indexOf(type) !== -1) {
|
|
455
|
-
capture = true;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
return componentEvent.unbind(el, type, fn, capture);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
var delegate = {
|
|
462
|
-
bind: bind$2,
|
|
463
|
-
unbind: unbind$1
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Expose `parse`.
|
|
468
|
-
*/
|
|
469
|
-
|
|
470
|
-
var domify = parse;
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Tests for browser support.
|
|
474
|
-
*/
|
|
475
|
-
|
|
476
|
-
var innerHTMLBug = false;
|
|
477
|
-
var bugTestDiv;
|
|
478
|
-
if (typeof document !== 'undefined') {
|
|
479
|
-
bugTestDiv = document.createElement('div');
|
|
480
|
-
// Setup
|
|
481
|
-
bugTestDiv.innerHTML = ' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
|
|
482
|
-
// Make sure that link elements get serialized correctly by innerHTML
|
|
483
|
-
// This requires a wrapper element in IE
|
|
484
|
-
innerHTMLBug = !bugTestDiv.getElementsByTagName('link').length;
|
|
485
|
-
bugTestDiv = undefined;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* Wrap map from jquery.
|
|
490
|
-
*/
|
|
491
|
-
|
|
492
|
-
var map$1 = {
|
|
493
|
-
legend: [1, '<fieldset>', '</fieldset>'],
|
|
494
|
-
tr: [2, '<table><tbody>', '</tbody></table>'],
|
|
495
|
-
col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
|
496
|
-
// for script/link/style tags to work in IE6-8, you have to wrap
|
|
497
|
-
// in a div with a non-whitespace character in front, ha!
|
|
498
|
-
_default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
map$1.td =
|
|
502
|
-
map$1.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
|
503
|
-
|
|
504
|
-
map$1.option =
|
|
505
|
-
map$1.optgroup = [1, '<select multiple="multiple">', '</select>'];
|
|
506
|
-
|
|
507
|
-
map$1.thead =
|
|
508
|
-
map$1.tbody =
|
|
509
|
-
map$1.colgroup =
|
|
510
|
-
map$1.caption =
|
|
511
|
-
map$1.tfoot = [1, '<table>', '</table>'];
|
|
512
|
-
|
|
513
|
-
map$1.polyline =
|
|
514
|
-
map$1.ellipse =
|
|
515
|
-
map$1.polygon =
|
|
516
|
-
map$1.circle =
|
|
517
|
-
map$1.text =
|
|
518
|
-
map$1.line =
|
|
519
|
-
map$1.path =
|
|
520
|
-
map$1.rect =
|
|
521
|
-
map$1.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Parse `html` and return a DOM Node instance, which could be a TextNode,
|
|
525
|
-
* HTML DOM Node of some kind (<div> for example), or a DocumentFragment
|
|
526
|
-
* instance, depending on the contents of the `html` string.
|
|
527
|
-
*
|
|
528
|
-
* @param {String} html - HTML string to "domify"
|
|
529
|
-
* @param {Document} doc - The `document` instance to create the Node for
|
|
530
|
-
* @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
|
|
531
|
-
* @api private
|
|
532
|
-
*/
|
|
533
|
-
|
|
534
|
-
function parse(html, doc) {
|
|
535
|
-
if ('string' != typeof html) throw new TypeError('String expected');
|
|
536
|
-
|
|
537
|
-
// default to the global `document` object
|
|
538
|
-
if (!doc) doc = document;
|
|
539
|
-
|
|
540
|
-
// tag name
|
|
541
|
-
var m = /<([\w:]+)/.exec(html);
|
|
542
|
-
if (!m) return doc.createTextNode(html);
|
|
543
|
-
|
|
544
|
-
html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
|
|
545
|
-
|
|
546
|
-
var tag = m[1];
|
|
547
|
-
|
|
548
|
-
// body support
|
|
549
|
-
if (tag == 'body') {
|
|
550
|
-
var el = doc.createElement('html');
|
|
551
|
-
el.innerHTML = html;
|
|
552
|
-
return el.removeChild(el.lastChild);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
// wrap map
|
|
556
|
-
var wrap = map$1[tag] || map$1._default;
|
|
557
|
-
var depth = wrap[0];
|
|
558
|
-
var prefix = wrap[1];
|
|
559
|
-
var suffix = wrap[2];
|
|
560
|
-
var el = doc.createElement('div');
|
|
561
|
-
el.innerHTML = prefix + html + suffix;
|
|
562
|
-
while (depth--) el = el.lastChild;
|
|
563
|
-
|
|
564
|
-
// one element
|
|
565
|
-
if (el.firstChild == el.lastChild) {
|
|
566
|
-
return el.removeChild(el.firstChild);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
// several elements
|
|
570
|
-
var fragment = doc.createDocumentFragment();
|
|
571
|
-
while (el.firstChild) {
|
|
572
|
-
fragment.appendChild(el.removeChild(el.firstChild));
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
return fragment;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
function query(selector, el) {
|
|
579
|
-
el = el || document;
|
|
580
|
-
|
|
581
|
-
return el.querySelector(selector);
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
function remove(el) {
|
|
585
|
-
el.parentNode && el.parentNode.removeChild(el);
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
export { assign$1 as assignStyle, attr, classes, closest, delegate, domify, componentEvent as event, matchesSelector as matches, query, remove };
|